config = $this->createMock(IConfig::class); $this->userManager = $this->createMock(IUserManager::class); $this->expiration = $this->createMock(Expiration::class); $this->jobList = $this->createMock(IJobList::class); $this->jobList->expects($this->once()) ->method('setLastRun'); $this->jobList->expects($this->once()) ->method('setExecutionTime'); } public function testBackgroundJobDeactivated(): void { $this->config->method('getAppValue') ->with('files_versions', 'background_job_expire_versions', 'yes') ->willReturn('no'); $this->expiration->expects($this->never()) ->method('getMaxAgeAsTimestamp'); $timeFactory = $this->createMock(ITimeFactory::class); $timeFactory->method('getTime') ->with() ->willReturn(999999999); $job = new ExpireVersions($this->config, $this->userManager, $this->expiration, $timeFactory); $job->start($this->jobList); } }