Jsor\Doctrine\PostGIS\Functions\ST_MPointFromTextTest::testQuery1 PHP Method

testQuery1() public method

public testQuery1 ( )
    public function testQuery1()
    {
        $query = $this->_getEntityManager()->createQuery('SELECT ST_MPointFromText(\'MULTIPOINT(-70.9590 42.1180, -70.9611 42.1223)\', 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 => '0104000020E61000000200000001010000004C37894160BD51C0C976BE9F1A0F45400101000000E10B93A982BD51C08126C286A70F4540');
        $this->assertEquals($expected, $result, '', 0.0001);
    }