public function test_ShouldCallRestart() { $timeMock = $this->getMock(TimeIntervalInterface::class); $timeMock->expects($this->once())->method("restart"); /** @var TimeIntervalInterface $timeMock */ $rp = new RotatingProxy("test", null, -1, -1, $timeMock); $rp->restartWaitingTime(); }