public function testReverseThrowsChainNoResult() { $mockOne = $this->getMock('Geocoder\\Provider\\Provider'); $mockOne->expects($this->exactly(2))->method('reverse')->will($this->returnCallback(function () { throw new \Exception(); })); $chain = new Chain(array($mockOne, $mockOne)); try { $chain->reverse('11', '22'); } catch (ChainNoResult $e) { $this->assertCount(2, $e->getExceptions()); } }