public function testMaxRetries() { $response = $this->getMockBuilder('Buzz\\Message\\Response')->getMock(); $response->method('isEmpty')->willReturn(true); $request = $this->getMockBuilder('Buzz\\Message\\Request')->getMock(); $client = $this->getMockBuilder('Buzz\\Client\\Curl')->getMock(); $entity = new ExternalRoute($response, $request, $client); $this->assertInstanceOf('Buzz\\Message\\Response', $entity->process(function ($request) { })); $this->assertFalse($entity->isSuccessful()); }