diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-12-06 12:14:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-06 12:14:43 +0100 |
commit | 1821712615cc4adc4a600ad8a86c4d68764bd3a6 (patch) | |
tree | 15fdb1f2754ac79fb779ad94d7117c9272e9df78 /tests | |
parent | 48358bb78f5955e982bcd07e7db252ad0ae43819 (diff) | |
parent | 72c7fad1c4997f7dd386f2476a084dcbbcc665a9 (diff) | |
download | nextcloud-server-1821712615cc4adc4a600ad8a86c4d68764bd3a6.tar.gz nextcloud-server-1821712615cc4adc4a600ad8a86c4d68764bd3a6.zip |
Merge pull request #35596 from nextcloud/fix/move-to-ocp-timedjob
Use TimedJob from OCP instead of OC
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'); |