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 /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 'tests')
-rw-r--r-- | tests/lib/Preview/BackgroundCleanupJobTest.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/lib/Preview/BackgroundCleanupJobTest.php b/tests/lib/Preview/BackgroundCleanupJobTest.php index cd9f6ef0399..c1c225bd179 100644 --- a/tests/lib/Preview/BackgroundCleanupJobTest.php +++ b/tests/lib/Preview/BackgroundCleanupJobTest.php @@ -25,6 +25,7 @@ namespace Test\Preview; use OC\Preview\BackgroundCleanupJob; use OC\Preview\Storage\Root; use OC\PreviewManager; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\Files\File; use OCP\Files\IMimeTypeLoader; use OCP\Files\IRootFolder; @@ -62,6 +63,8 @@ class BackgroundCleanupJobTest extends \Test\TestCase { /** @var IMimeTypeLoader */ private $mimeTypeLoader; + private ITimeFactory $timeFactory; + protected function setUp(): void { parent::setUp(); @@ -83,6 +86,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase { $this->previewManager = \OC::$server->getPreviewManager(); $this->rootFolder = \OC::$server->getRootFolder(); $this->mimeTypeLoader = \OC::$server->getMimeTypeLoader(); + $this->timeFactory = \OCP\Server::get(ITimeFactory::class); } protected function tearDown(): void { @@ -142,7 +146,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase { $root = $this->getRoot(); $this->assertSame(11, $this->countPreviews($root, $fileIds)); - $job = new BackgroundCleanupJob($this->connection, $root, $this->mimeTypeLoader, true); + $job = new BackgroundCleanupJob($this->timeFactory, $this->connection, $root, $this->mimeTypeLoader, true); $job->run([]); foreach ($files as $file) { @@ -166,7 +170,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase { $root = $this->getRoot(); $this->assertSame(11, $this->countPreviews($root, $fileIds)); - $job = new BackgroundCleanupJob($this->connection, $root, $this->mimeTypeLoader, false); + $job = new BackgroundCleanupJob($this->timeFactory, $this->connection, $root, $this->mimeTypeLoader, false); $job->run([]); foreach ($files as $file) { @@ -196,7 +200,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase { $appdata = \OC::$server->getAppDataDir('preview'); $this->assertSame(2, count($appdata->getDirectoryListing())); - $job = new BackgroundCleanupJob($this->connection, $this->getRoot(), $this->mimeTypeLoader, true); + $job = new BackgroundCleanupJob($this->timeFactory, $this->connection, $this->getRoot(), $this->mimeTypeLoader, true); $job->run([]); $appdata = \OC::$server->getAppDataDir('preview'); |