public function testGetLimit() { $graph = new Graph(); $vertex = $graph->v(); $this->assertEquals($vertex, $vertex->getLimit(42)); $this->assertEquals('graph.Vertex().GetLimit(42)', (string) $vertex); }
public function testQuery() { $cayley = new Client(); $graph = new Graph(); $graph->emit('Hello World'); $result = $cayley->query($graph); $this->assertInstanceOf('Cayley\\Response\\QueryResult', $result); $this->assertEquals('Hello World', iterator_to_array($result)[0]); }
public function testIntersect() { $graphA = new Graph(); $cFollows = $graphA->v('C')->out('follows'); $graphB = new Graph(); $dFollows = $graphB->v('D')->out('follows'); $cFollows->intersect($cFollows); $this->assertEquals('graph.Vertex().Out("follows").Intersect(graph.Vertex().Out("follows")).All()', (string) $cFollows->all()); }
public function testVertexWithNodes() { $graph = new Graph(); $this->assertInstanceOf('Cayley\\Gremlin\\Vertex', $graph->vertex(['foo', 'bar'])); $this->assertEquals('graph.Vertex("foo", "bar")', (string) $graph); }