public function testQuery1()
{
$query = $this->_getEntityManager()->createQuery('SELECT ST_AsEWKT(ST_GeomFromWKB(ST_AsEWKB(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 => 'SRID=4326;POLYGON((0 0,0 1,1 1,1 0,0 0))');
$this->assertEquals($expected, $result, '', 0.0001);
}