public function testCyclePlugin() { $geocoder = new Coder(array(new Mock(array('name' => 'resolution didnt work', 'retval' => false)), new Mock(array('name' => 'resolution worked', 'retval' => true)))); $result = $geocoder->fetchCoords('Müllerstr. 40, 80469 München', Coder::PRECISION_HIGH); $this->assertInstanceOf('\\Geo\\Coder\\PluginInterface', $result); $this->assertEquals('resolution worked', $result->getClass()); $this->assertEquals(Coder::PRECISION_HIGH, $result->getPrecision()); }
public static function setUpBeforeClass() { self::$geocoder = new Coder(new Nominatim(array('requestURI' => 'http://nominatim.openstreetmap.org/search', 'i118n' => 'en'))); self::$result = self::$geocoder->fetchCoords('Müllerstr. 40, 80469 München', Coder::PRECISION_HIGH); }