Jsor\Doctrine\PostGIS\Functions\ST_AsLatLonTextTest::testQuery2 PHP Method

testQuery2() public method

public testQuery2 ( )
    public function testQuery2()
    {
        $query = $this->_getEntityManager()->createQuery('SELECT ST_AsLatLonText(\'POINT (-3.2342342 -2.32498)\', \'D°M\'\'S.SSS"C\') 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 => '2°19\'29.928"S 3°14\'3.243"W');
        $this->assertEquals($expected, $result, '', 0.0001);
    }