Jsor\Doctrine\PostGIS\Functions\ST_MakePolygonTest::testQuery1 PHP Method

testQuery1() public method

public testQuery1 ( )
    public function testQuery1()
    {
        $query = $this->_getEntityManager()->createQuery('SELECT ST_AsEWKT(ST_MakePolygon(ST_GeomFromText(\'LINESTRING(75.15 29.53,77 29,77.6 29.5, 75.15 29.53)\'))) FROM Jsor\\Doctrine\\PostGIS\\PointsEntity');
        $result = $query->getSingleResult();
        array_walk_recursive($result, function (&$data) {
            if (is_resource($data)) {
                $data = stream_get_contents($data);
                if (false !== ($pos = strpos($data, 'x'))) {
                    $data = substr($data, $pos + 1);
                }
            }
            if (is_string($data)) {
                $data = trim($data);
            }
        });
        $expected = array(1 => 'POLYGON((75.15 29.53,77 29,77.6 29.5,75.15 29.53))');
        $this->assertEquals($expected, $result, '', 0.0001);
    }
ST_MakePolygonTest