protected function createApiMethodMock($method, callable $validator) { $timer = $this->createTimerMock(); $react = new ReactTimer($timer); $timer->expects($this->once())->method($method)->will($this->returnCallback($validator)); return $react; }