aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-07-18 11:21:03 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-08-08 17:03:51 +0200
commit49334e4d9c278d33ce9fd4195b5a12af99821be2 (patch)
tree45ffe11ad48be373ad7a46f4214d285b18a7670e /apps/files_trashbin
parent48d9c4d2b093e12ec3bf3cd29295da0f2277028f (diff)
downloadnextcloud-server-49334e4d9c278d33ce9fd4195b5a12af99821be2.tar.gz
nextcloud-server-49334e4d9c278d33ce9fd4195b5a12af99821be2.zip
Fix many tests and warnings
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php b/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php
index d8cce61ca52..bf5d6bc65ae 100644
--- a/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php
+++ b/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php
@@ -48,9 +48,6 @@ class ExpireTrashTest extends TestCase {
/** @var IJobList|MockObject */
private $jobList;
- /** @var LoggerInterface|MockObject */
- private $logger;
-
/** @var ITimeFactory|MockObject */
private $time;
@@ -61,8 +58,10 @@ class ExpireTrashTest extends TestCase {
$this->userManager = $this->createMock(IUserManager::class);
$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->time->method('getTime')
+ ->willReturn(99999999999);
$this->jobList->expects($this->once())
->method('setLastRun');
@@ -71,8 +70,12 @@ class ExpireTrashTest extends TestCase {
}
public function testConstructAndRun(): void {
- $job = new ExpireTrash($this->config, $this->userManager, $this->expiration);
- $job->execute($this->jobList, $this->logger);
+ $this->config->method('getAppValue')
+ ->with('files_trashbin', 'background_job_expire_trash', 'yes')
+ ->willReturn('yes');
+
+ $job = new ExpireTrash($this->config, $this->userManager, $this->expiration, $this->time);
+ $job->start($this->jobList);
}
public function testBackgroundJobDeactivated(): void {