diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-12-05 11:32:49 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-12-05 11:32:49 +0100 |
commit | 72c7fad1c4997f7dd386f2476a084dcbbcc665a9 (patch) | |
tree | 8b7d946ccb7b7c25d6f379690f4a829f02fa6d82 /apps/updatenotification | |
parent | 578648a062e9cb72248a2f625ac367d19033a24e (diff) | |
download | nextcloud-server-72c7fad1c4997f7dd386f2476a084dcbbcc665a9.tar.gz nextcloud-server-72c7fad1c4997f7dd386f2476a084dcbbcc665a9.zip |
Fix job tests in updatenotification and user_ldap applications
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/updatenotification')
-rw-r--r-- | apps/updatenotification/tests/Notification/BackgroundJobTest.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/apps/updatenotification/tests/Notification/BackgroundJobTest.php b/apps/updatenotification/tests/Notification/BackgroundJobTest.php index d4d7a543e56..70d1a918a01 100644 --- a/apps/updatenotification/tests/Notification/BackgroundJobTest.php +++ b/apps/updatenotification/tests/Notification/BackgroundJobTest.php @@ -31,6 +31,7 @@ use OC\Installer; use OC\Updater\VersionCheck; use OCA\UpdateNotification\Notification\BackgroundJob; use OCP\App\IAppManager; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\Http\Client\IClientService; use OCP\IConfig; use OCP\IGroup; @@ -38,22 +39,24 @@ use OCP\IGroupManager; use OCP\IUser; use OCP\Notification\IManager; use OCP\Notification\INotification; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class BackgroundJobTest extends TestCase { - - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IConfig|MockObject */ protected $config; - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IManager|MockObject */ protected $notificationManager; - /** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IGroupManager|MockObject */ protected $groupManager; - /** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IAppManager|MockObject */ protected $appManager; - /** @var IClientService|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IClientService|MockObject */ protected $client; - /** @var Installer|\PHPUnit\Framework\MockObject\MockObject */ + /** @var Installer|MockObject */ protected $installer; + /** @var ITimeFactory|MockObject */ + protected $timeFactory; protected function setUp(): void { parent::setUp(); @@ -64,15 +67,17 @@ class BackgroundJobTest extends TestCase { $this->appManager = $this->createMock(IAppManager::class); $this->client = $this->createMock(IClientService::class); $this->installer = $this->createMock(Installer::class); + $this->timeFactory = $this->createMock(ITimeFactory::class); } /** * @param array $methods - * @return BackgroundJob|\PHPUnit\Framework\MockObject\MockObject + * @return BackgroundJob|MockObject */ protected function getJob(array $methods = []) { if (empty($methods)) { return new BackgroundJob( + $this->timeFactory, $this->config, $this->notificationManager, $this->groupManager, @@ -84,6 +89,7 @@ class BackgroundJobTest extends TestCase { { return $this->getMockBuilder(BackgroundJob::class) ->setConstructorArgs([ + $this->timeFactory, $this->config, $this->notificationManager, $this->groupManager, @@ -429,7 +435,7 @@ class BackgroundJobTest extends TestCase { /** * @param string[] $userIds - * @return IUser[]|\PHPUnit\Framework\MockObject\MockObject[] + * @return IUser[]|MockObject[] */ protected function getUsers(array $userIds): array { $users = []; @@ -445,7 +451,7 @@ class BackgroundJobTest extends TestCase { /** * @param string $gid - * @return \OCP\IGroup|\PHPUnit\Framework\MockObject\MockObject + * @return \OCP\IGroup|MockObject */ protected function getGroup(string $gid) { $group = $this->createMock(IGroup::class); |