public function testGetReversedDataWithRealCoordinatesWithTRLocaleAndLocalityToponym()
 {
     $provider = new YandexProvider($this->getAdapter(), 'tr-TR', 'locality');
     $results = $provider->getReversedData(array(40.90064, 29.198184));
     $this->assertInternalType('array', $results);
     $this->assertCount(5, $results);
     $this->assertInternalType('array', $results[0]);
     $this->assertEquals(40.909452, $results[0]['latitude'], '', 0.01);
     $this->assertEquals(29.138608, $results[0]['longitude'], '', 0.01);
     $this->assertEquals(40.860413, $results[0]['bounds']['south'], '', 0.01);
     $this->assertEquals(29.072708, $results[0]['bounds']['west'], '', 0.01);
     $this->assertEquals(40.960403, $results[0]['bounds']['north'], '', 0.01);
     $this->assertEquals(29.204508, $results[0]['bounds']['east'], '', 0.01);
     $this->assertNull($results[0]['streetNumber']);
     $this->assertEquals('İstanbul', $results[0]['region']);
     $this->assertNull($results[0]['streetName']);
     $this->assertEquals('Dragos', $results[0]['city']);
     $this->assertEquals('Türkiye', $results[0]['country']);
     $this->assertEquals('TR', $results[0]['countryCode']);
     // not provided
     $this->assertNull($results[0]['zipcode']);
     $this->assertNull($results[0]['cityDistrict']);
     $this->assertNull($results[0]['regionCode']);
     $this->assertNull($results[0]['timezone']);
     $this->assertInternalType('array', $results[1]);
     $this->assertInternalType('array', $results[2]);
     $this->assertInternalType('array', $results[3]);
     $this->assertInternalType('array', $results[4]);
 }
Beispiel #2
0
 public function testGetReversedDataWithRealCoordinatesWithTRLocaleAndLocalityToponym()
 {
     $provider = new YandexProvider(new \Geocoder\HttpAdapter\CurlHttpAdapter(), 'tr-TR', 'locality');
     $result = $provider->getReversedData(array(40.90064, 29.198184));
     $this->assertEquals(40.909452, $result['latitude'], '', 0.0001);
     $this->assertEquals(29.052244, $result['longitude'], '', 0.0001);
     $this->assertEquals(40.903932, $result['bounds']['south'], '', 0.0001);
     $this->assertEquals(29.041446, $result['bounds']['west'], '', 0.0001);
     $this->assertEquals(40.913759, $result['bounds']['north'], '', 0.0001);
     $this->assertEquals(29.056834, $result['bounds']['east'], '', 0.0001);
     $this->assertNull($result['streetNumber']);
     $this->assertEquals('İstanbul', $result['cityDistrict']);
     $this->assertNull($result['streetName']);
     $this->assertEquals('Türkiye', $result['country']);
     $this->assertEquals('TR', $result['countryCode']);
     // not provided
     $this->assertNull($result['zipcode']);
     $this->assertNull($result['city']);
     $this->assertNull($result['region']);
     $this->assertNull($result['regionCode']);
     $this->assertNull($result['timezone']);
 }