public function testPollRetriesAndGivesUpAfterTimeout() { $this->poller->expects($this->at(0))->method('poll')->with(0, 0)->willReturnCallback(function () { usleep(100); return false; }); $this->assertFalse(poll([$this->poller, 'poll'], 100)); }