public function testQuery1()
{
$query = $this->_getEntityManager()->createQuery('SELECT ST_AsGML(ST_GeomFromText(\'POLYGON((0 0,0 1,1 1,1 0,0 0))\',4326)) 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 => '<gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,0 0,1 1,1 1,0 0,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>');
$this->assertEquals($expected, $result, '', 0.0001);
}