neoxygen / neo4j-neoclient

Simple PHP HttpClient for the Neo4j ReST API with Multi DB Support
MIT License
121 stars 138 forks source link

formatter issue #58

Closed ikwattro closed 9 years ago

ikwattro commented 9 years ago

Reported issue

[3/08/15 11:06:07] giugnofabrizio: $query = "MATCH (a:Property {uid:{uid}}) RETURN a AS property,labels(a) AS labels";

            $params = [];
            $params['uid'] = $uid;

            $resp = NeoClient::sendReadQuery($query,$params)->getRows();
[3/08/15 11:06:23] giugnofabrizio: ErrorException in ResponseFormatter.php line 320:
Undefined offset: 1
ikwattro commented 9 years ago

fixed by 0c5cc8b064023d2f40b47c444588393deaef01c2

Test :

/**
     * @group issues
     */
    public function testReportedIssue()
    {
        $this->emptyDatabase();
        $state = '(:Property:Item:OtherLabel {id: 1})';
        $this->prepareDatabase($state);

        $q = 'MATCH (n:Property {id:1}) RETURN n as property, labels(n) as labels';
        $result = $this->getConnection()->sendCypherQuery($q)->getResult();

        $this->assertCount(3, $result->get('labels'));
        $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Node', $result->get('property'));
    }