aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/tests
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-06-28 12:55:26 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-08-08 17:03:19 +0200
commit48d9c4d2b093e12ec3bf3cd29295da0f2277028f (patch)
treed66f1d2f54e8ae745fc7ce7bf067ce2072eeac6a /apps/files_trashbin/tests
parent19a2d6f6e7d54eb9318279809bf6c3f40bf566e2 (diff)
downloadnextcloud-server-48d9c4d2b093e12ec3bf3cd29295da0f2277028f.tar.gz
nextcloud-server-48d9c4d2b093e12ec3bf3cd29295da0f2277028f.zip
Port existing server code to new interface
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/files_trashbin/tests')
-rw-r--r--apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php b/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php
index c49501608f7..d8cce61ca52 100644
--- a/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php
+++ b/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php
@@ -27,12 +27,13 @@ namespace OCA\Files_Trashbin\Tests\BackgroundJob;
use OCA\Files_Trashbin\BackgroundJob\ExpireTrash;
use OCA\Files_Trashbin\Expiration;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IUserManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
+use Psr\Log\LoggerInterface;
class ExpireTrashTest extends TestCase {
/** @var IConfig|MockObject */
@@ -47,9 +48,12 @@ class ExpireTrashTest extends TestCase {
/** @var IJobList|MockObject */
private $jobList;
- /** @var ILogger|MockObject */
+ /** @var LoggerInterface|MockObject */
private $logger;
+ /** @var ITimeFactory|MockObject */
+ private $time;
+
protected function setUp(): void {
parent::setUp();
@@ -58,6 +62,7 @@ class ExpireTrashTest extends TestCase {
$this->expiration = $this->createMock(Expiration::class);
$this->jobList = $this->createMock(IJobList::class);
$this->logger = $this->createMock(ILogger::class);
+ $this->time = $this->createMock(ITimeFactory::class);
$this->jobList->expects($this->once())
->method('setLastRun');
@@ -77,7 +82,7 @@ class ExpireTrashTest extends TestCase {
$this->expiration->expects($this->never())
->method('getMaxAgeAsTimestamp');
- $job = new ExpireTrash($this->config, $this->userManager, $this->expiration);
- $job->execute($this->jobList, $this->logger);
+ $job = new ExpireTrash($this->config, $this->userManager, $this->expiration, $this->time);
+ $job->start($this->jobList);
}
}