public function testQuery3()
{
$query = $this->_getEntityManager()->createQuery('SELECT ST_NumGeometries(ST_GeomFromText(\'GEOMETRYCOLLECTION(MULTIPOINT(-2 3 , -2 2),LINESTRING(5 5 ,10 10),POLYGON((-7 4.2,-7.1 5,-7.1 4.3,-7 4.2)))\')) 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 => 3);
$this->assertEquals($expected, $result, '', 0.0001);
}