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

testQuery2() public method

public testQuery2 ( )
    public function testQuery2()
    {
        $query = $this->_getEntityManager()->createQuery('SELECT ST_Length_Spheroid(ST_GeomFromText(\'MULTILINESTRING((-118.584 38.374,-118.583 38.5),(-71.05957 42.3589 , -71.061 43))\'),\'SPHEROID["GRS_1980",6378137,298.257222101]\') 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 => 85204.5207562954);
        $this->assertEquals($expected, $result, '', 0.0001);
    }
ST_Length_SpheroidTest