time = $this->createMock(ITimeFactory::class); $this->mapper = $this->createMock(UserStatusMapper::class); $this->job = new ClearOldStatusesBackgroundJob($this->time, $this->mapper); } public function testRun() { $this->mapper->expects($this->once()) ->method('clearOlderThanClearAt') ->with(1337); $this->mapper->expects($this->once()) ->method('clearStatusesOlderThan') ->with(437, 1337); $this->time->method('getTime') ->willReturn(1337); self::invokePrivate($this->job, 'run', [[]]); } }