Exemplo n.º 1
0
    public function testPosition()
    {
        $position = new Position();
        $position->setLatitude(34.34);
        $position->setLongitude(-127.23);
        $position->setAltitude(100.05);
        $content = <<<JSON
{
  "latitude": 34.34,
  "longitude": -127.23,
  "altitude": 100.05
}
JSON;
        $this->assertRecordEqualsContent($position, $content);
        $this->assertEquals(34.34, $position->getLatitude());
        $this->assertEquals(-127.23, $position->getLongitude());
        $this->assertEquals(100.05, $position->getAltitude());
    }
Exemplo n.º 2
0
    public function testPlacePosition()
    {
        $position = new Position();
        $position->setLatitude(34.34);
        $position->setLongitude(-127.23);
        $position->setAltitude(100.05);
        $place = new Place();
        $place->setDisplayName('Some Random Location on Earth');
        $place->setPosition($position);
        $content = <<<JSON
  {
    "objectType": "place",
    "displayName": "Some Random Location on Earth",
    "position": {
      "latitude": 34.34,
      "longitude": -127.23,
      "altitude": 100.05
    }
  }
JSON;
        $this->assertRecordEqualsContent($place, $content);
        $this->assertEquals($position, $place->getPosition());
    }