diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-12-05 10:41:13 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-12-05 10:41:13 +0100 |
commit | 578648a062e9cb72248a2f625ac367d19033a24e (patch) | |
tree | 3819f15ab39d5480042c71b57c9d27c2475a3ca4 /apps/files/tests | |
parent | a0f6a6545b59b1061e96e7d17d8ec6d6f32e615e (diff) | |
download | nextcloud-server-578648a062e9cb72248a2f625ac367d19033a24e.tar.gz nextcloud-server-578648a062e9cb72248a2f625ac367d19033a24e.zip |
Adapt tests to new job constructors
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php index 75318b1802f..f7562345d8a 100644 --- a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php +++ b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php @@ -24,6 +24,7 @@ namespace OCA\Files\Tests\BackgroundJob; use OCA\Files\BackgroundJob\DeleteOrphanedItems; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\DB\QueryBuilder\IQueryBuilder; /** @@ -34,13 +35,15 @@ use OCP\DB\QueryBuilder\IQueryBuilder; * @package Test\BackgroundJob */ class DeleteOrphanedItemsJobTest extends \Test\TestCase { - /** @var \OCP\IDBConnection */ protected $connection; + protected ITimeFactory $timeFactory; + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); + $this->timeFactory = $this->createMock(ITimeFactory::class); } protected function cleanMapping($table) { @@ -95,7 +98,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase { $mapping = $this->getMappings('systemtag_object_mapping'); $this->assertCount(2, $mapping); - $job = new DeleteOrphanedItems(); + $job = new DeleteOrphanedItems($this->timeFactory); $this->invokePrivate($job, 'cleanSystemTags'); $mapping = $this->getMappings('systemtag_object_mapping'); @@ -144,7 +147,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase { $mapping = $this->getMappings('vcategory_to_object'); $this->assertCount(2, $mapping); - $job = new DeleteOrphanedItems(); + $job = new DeleteOrphanedItems($this->timeFactory); $this->invokePrivate($job, 'cleanUserTags'); $mapping = $this->getMappings('vcategory_to_object'); @@ -195,7 +198,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase { $mapping = $this->getMappings('comments'); $this->assertCount(2, $mapping); - $job = new DeleteOrphanedItems(); + $job = new DeleteOrphanedItems($this->timeFactory); $this->invokePrivate($job, 'cleanComments'); $mapping = $this->getMappings('comments'); @@ -244,7 +247,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase { $mapping = $this->getMappings('comments_read_markers'); $this->assertCount(2, $mapping); - $job = new DeleteOrphanedItems(); + $job = new DeleteOrphanedItems($this->timeFactory); $this->invokePrivate($job, 'cleanCommentMarkers'); $mapping = $this->getMappings('comments_read_markers'); |