/** * @test */ public function lookUpForAFullGermanAddressWithErrorSendsNoRequest() { $geo = new Tx_Oelib_Tests_Unit_Fixtures_TestingGeo(); $geo->setGeoAddress('Am Hof 1, 53113 Zentrum, Bonn, DE'); $geo->setGeoError(); /** @var tx_oelib_Geocoding_Google|PHPUnit_Framework_MockObject_MockObject $subject */ $subject = $this->getMock('tx_oelib_Geocoding_Google', array('sendRequest', 'throttle'), array(), '', FALSE); $subject->expects(self::never())->method('sendRequest'); $subject->lookUp($geo); }
/** * @test * * @expectedException InvalidArgumentException */ public function calculateDistanceInKilometersForSecondObjectWithGeoErrorThrowsException() { $bonn = new Tx_Oelib_Tests_Unit_Fixtures_TestingGeo(); $bonn->setGeoCoordinates(array('latitude' => 50.72254683, 'longitude' => 7.07519531)); $brokenBonn = new Tx_Oelib_Tests_Unit_Fixtures_TestingGeo(); $brokenBonn->setGeoCoordinates(array('latitude' => 50.72254683, 'longitude' => 7.07519531)); $brokenBonn->setGeoError(); $this->subject->calculateDistanceInKilometers($bonn, $brokenBonn); }