public function testCreateFromArray()
 {
     $factory = new ResultFactory();
     $result = $factory->createFromArray(array('latitude' => 123, 'longitude' => 456));
     $this->assertTrue(is_object($result));
     $this->assertInstanceOf('Geocoder\\Result\\Geocoded', $result);
     $this->assertInstanceOf('Geocoder\\Result\\ResultInterface', $result);
     $this->assertEquals(123, $result->getLatitude());
     $this->assertEquals(456, $result->getLongitude());
 }
Beispiel #2
0
 /**
  * @param array $data An array of data.
  *
  * @return ResultInterface
  */
 protected function returnResult(array $data = array())
 {
     return $this->resultFactory->createFromArray($data);
 }