예제 #1
0
 public function setUp()
 {
     $this->sut = new Feature();
     $point = new Point(8.699999999999999, 6.9);
     $this->sut->setGeometry($point);
     $this->sut->addProperty('test', 'value');
 }
예제 #2
0
    public function testSingleFeature()
    {
        $point = new Point(8.699999999999999, 6.9);
        $feature = new Feature();
        $feature->setGeometry($point);
        $this->sut->addFeature($feature);
        $expectedJson = <<<END
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[8.7,6.9]},"properties":{}}]}
END;
        $this->assertEquals($expectedJson, json_encode($this->sut));
    }