These are chat archives for neoxygen/neo4j-neoclient

31st
Oct 2014
Abed Halawi
@Mulkave
Oct 31 2014 11:05
I got this test failing
$client = $this->getClient();
        $q = 'CREATE (u:`User` {name: {name}, email: {email}})-[:LIKES]->(p:`Post` {title: {title}}) RETURN u, p';
        $params = ['name' => 'Abed Halawi', 'email' => 'halawi.abed@gmail.com', 'title' => 'Sss'];
        $response = $client->sendCypherQuery($q, $params, null, array('graph'));
        $result = $response->getResult();

        $this->assertInstanceOf('Neoxygen\NeoClient\Formatter\Result',$result);

        $nodes = $result->getNodesByLabel(['User', 'Post'], true);

        $this->assertArrayHasKey('User', $nodes);
        $this->assertArrayHasKey('Post', $nodes);
although the $results has both nodes:
object(Neoxygen\NeoClient\Formatter\Result)#893 (3) {
  ["nodes":protected]=>
  array(2) {
    [27]=>
    object(Neoxygen\NeoClient\Formatter\Node)#910 (5) {
      ["id":protected]=>
      string(2) "27"
      ["labels":protected]=>
      array(1) {
        [0]=>
        string(4) "Post"
      }
      ["properties":protected]=>
      array(1) {
        ["title"]=>
        string(3) "Sss"
      }
      ["inboundRelationships":protected]=>
      array(0) {
      }
      ["outboundRelationships":protected]=>
      array(0) {
      }
    }
    [26]=>
    object(Neoxygen\NeoClient\Formatter\Node)#899 (5) {
      ["id":protected]=>
      string(2) "26"
      ["labels":protected]=>
      array(1) {
        [0]=>
        string(4) "User"
      }
      ["properties":protected]=>
      array(2) {
        ["name"]=>
        string(11) "Abed Halawi"
        ["email"]=>
        string(21) "halawi.abed@gmail.com"
      }
      ["inboundRelationships":protected]=>
      array(0) {
      }
      ["outboundRelationships":protected]=>
      array(0) {
      }
    }
  }
  ["relationships":protected]=>
  array(0) {
  }
  ["errors":protected]=>
  NULL
}
Christophe Willemsen
@ikwattro
Oct 31 2014 11:38
you're there ?
Christophe Willemsen
@ikwattro
Oct 31 2014 11:45
You should use or getNodes(['label','label'], true)
or getNodesByLabels with a "s" at then end ;-)
Abed Halawi
@Mulkave
Oct 31 2014 12:54
right, these worked
updated the test to run both :smile:
InvalidArgumentException: The method "getLabes" does not exist
does the 2.0@dev branch have this ?
Christophe Willemsen
@ikwattro
Oct 31 2014 12:59
you miss a l
getLabels
Abed Halawi
@Mulkave
Oct 31 2014 12:59
ah sorry
Christophe Willemsen
@ikwattro
Oct 31 2014 12:59
:)
Abed Halawi
@Mulkave
Oct 31 2014 13:07
but createIndex doesn’t seem to exist..
pretty sure about this one this time :blush:
Christophe Willemsen
@ikwattro
Oct 31 2014 13:09
yes I see that too
I'll push them in a few minutes
pushed ;-)
Abed Halawi
@Mulkave
Oct 31 2014 13:11
:thumbsup:
so getRoot() is now returning a Neoxygen\NeoClient\Formatter\Response instance and getRoot()->getResult() returns null
although I can see the results in there:
object(Neoxygen\NeoClient\Formatter\Response)#1784 (4) {
  ["rawResponse":"Neoxygen\NeoClient\Formatter\Response":private]=>
  array(2) {
    ["management"]=>
    string(37) "http://192.168.59.103:7474/db/manage/"
    ["data"]=>
    string(35) "http://192.168.59.103:7474/db/data/"
  }
  ["results":"Neoxygen\NeoClient\Formatter\Response":private]=>
  NULL
  ["rows":"Neoxygen\NeoClient\Formatter\Response":private]=>
  NULL
  ["errors":"Neoxygen\NeoClient\Formatter\Response":private]=>
  array(0) {
  }
}
Christophe Willemsen
@ikwattro
Oct 31 2014 13:12
no I changed it a bit
if you call ->getResult()
instead of throwing an exception if a Result Object does not exist
it returns the response
maybe something to think of
Also, I think for responses not having a Result Object or a Rows content
it will return the raw array response
Abed Halawi
@Mulkave
Oct 31 2014 13:17
hmm, in that the Result instance should have an isEmpty() check or something of that sort
Christophe Willemsen
@ikwattro
Oct 31 2014 13:17
currently doing it
containsResults()
was already there
added hasRows()
will push now
PUSHED
from which repository are you doing the test
so I can see which tests you're doing and integrate them in my test suite
Abed Halawi
@Mulkave
Oct 31 2014 13:26
required ~2.0@dev
Christophe Willemsen
@ikwattro
Oct 31 2014 13:26
no i mean in your lib
Abed Halawi
@Mulkave
Oct 31 2014 13:26
ah right, let me push the latest
Christophe Willemsen
@ikwattro
Oct 31 2014 13:26
neoclient-tryout ?
Abed Halawi
@Mulkave
Oct 31 2014 13:26
updated master
Christophe Willemsen
@ikwattro
Oct 31 2014 13:27
thanks
Abed Halawi
@Mulkave
Oct 31 2014 13:27
sure