Sokil\Mongo\DocumentGeoTest::testSetGeometryCollection PHP Method

testSetGeometryCollection() public method

    public function testSetGeometryCollection()
    {
        $documentId = $this->collection->createDocument()->setGeometryCollection('location', array(new \GeoJson\Geometry\Point(array(30.523400000000038, 50.4501)), new \GeoJson\Geometry\LineString(array(array(30.523400000000038, 50.4501), array(24.012228, 49.831485), array(36.230376, 49.993499))), new \GeoJson\Geometry\Polygon(array(array(array(24.012228, 49.831485), array(36.230376, 49.993499), array(34.174927, 45.035993), array(24.012228, 49.831485)), array(array(34.551416, 49.588264), array(32.049226, 49.431181), array(35.139561, 47.838796), array(34.551416, 49.588264))))))->save()->getId();
        $this->assertEquals(array('type' => 'GeometryCollection', 'geometries' => array(array('type' => 'Point', 'coordinates' => array(30.523400000000038, 50.4501)), array('type' => 'LineString', 'coordinates' => array(array(30.523400000000038, 50.4501), array(24.012228, 49.831485), array(36.230376, 49.993499))), array('type' => 'Polygon', 'coordinates' => array(array(array(24.012228, 49.831485), array(36.230376, 49.993499), array(34.174927, 45.035993), array(24.012228, 49.831485)), array(array(34.551416, 49.588264), array(32.049226, 49.431181), array(35.139561, 47.838796), array(34.551416, 49.588264)))))), $this->collection->getDocument($documentId)->get('location'));
    }