1414use OCP \IAppConfig ;
1515use OCP \IUserManager ;
1616use PHPUnit \Framework \MockObject \MockObject ;
17+ use Psr \Log \LoggerInterface ;
1718use Test \TestCase ;
1819
1920class ExpireTrashTest extends TestCase {
@@ -29,6 +30,9 @@ class ExpireTrashTest extends TestCase {
2930 /** @var IJobList&MockObject */
3031 private $ jobList ;
3132
33+ /** @var LoggerInterface&MockObject */
34+ private $ logger ;
35+
3236 /** @var ITimeFactory&MockObject */
3337 private $ time ;
3438
@@ -39,6 +43,7 @@ protected function setUp(): void {
3943 $ this ->userManager = $ this ->createMock (IUserManager::class);
4044 $ this ->expiration = $ this ->createMock (Expiration::class);
4145 $ this ->jobList = $ this ->createMock (IJobList::class);
46+ $ this ->logger = $ this ->createMock (LoggerInterface::class);
4247
4348 $ this ->time = $ this ->createMock (ITimeFactory::class);
4449 $ this ->time ->method ('getTime ' )
@@ -58,7 +63,7 @@ public function testConstructAndRun(): void {
5863 ->with ('files_trashbin ' , 'background_job_expire_trash_offset ' , 0 )
5964 ->willReturn (0 );
6065
61- $ job = new ExpireTrash ($ this ->appConfig , $ this ->userManager , $ this ->expiration , $ this ->time );
66+ $ job = new ExpireTrash ($ this ->appConfig , $ this ->userManager , $ this ->expiration , $ this ->logger , $ this -> time );
6267 $ job ->start ($ this ->jobList );
6368 }
6469
@@ -69,7 +74,7 @@ public function testBackgroundJobDeactivated(): void {
6974 $ this ->expiration ->expects ($ this ->never ())
7075 ->method ('getMaxAgeAsTimestamp ' );
7176
72- $ job = new ExpireTrash ($ this ->appConfig , $ this ->userManager , $ this ->expiration , $ this ->time );
77+ $ job = new ExpireTrash ($ this ->appConfig , $ this ->userManager , $ this ->expiration , $ this ->logger , $ this -> time );
7378 $ job ->start ($ this ->jobList );
7479 }
7580}
0 commit comments