저자: Richard Barnes (rbarnes@umn.edu)
상속: implements Location\Formatter\Polygon\FormatterInterface
예제 #1
0
 /**
  * @covers Location\Formatter\Coordinate\DecimalDegrees::format
  */
 public function testFormatDefault()
 {
     $polygon = new Polygon();
     $polygon->addPoint(new Coordinate(10, 20));
     $polygon->addPoint(new Coordinate(20, 40));
     $polygon->addPoint(new Coordinate(30, 40));
     $polygon->addPoint(new Coordinate(30, 20));
     $json = '{ "type" : "Polygon" , "coordinates" : [ [ 20, 10 ], [ 40, 20 ], [ 40, 30 ], [ 20, 30] ] }';
     $this->assertJsonStringEqualsJsonString($json, $this->formatter->format($polygon));
 }