private function getHelper(array $numbers) { $randomMock = $this->getMock(RandomizerInterface::class); $h = new RandomAndTimeHelper($numbers, null, null, $randomMock); $randomMock->expects($this->any())->method("randNum")->will($this->returnCallback($h->getGetRandomNumberFn())); return $h; }
private function getHelper(array $numbers = null, array $times = null, array $randKeys = null) { $randomMock = $this->getMock(RandomizerInterface::class); $timeMock = $this->getMock(TimeProviderInterface::class); $h = new RandomAndTimeHelper($numbers, $times, $randKeys, $randomMock, $timeMock); $randomMock->expects($this->any())->method("randNum")->will($this->returnCallback($h->getGetRandomNumberFn())); $randomMock->expects($this->any())->method("randKey")->will($this->returnCallback($h->getGetRandomKeyFn())); $timeMock->expects($this->any())->method("getTime")->will($this->returnCallback($h->getGetRandomTimeFn())); return $h; }