Exemplo n.º 1
0
 public function testGetLimit()
 {
     $graph = new Graph();
     $vertex = $graph->v();
     $this->assertEquals($vertex, $vertex->getLimit(42));
     $this->assertEquals('graph.Vertex().GetLimit(42)', (string) $vertex);
 }
Exemplo n.º 2
0
 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());
 }
Exemplo n.º 4
0
 public function testVertexWithNodes()
 {
     $graph = new Graph();
     $this->assertInstanceOf('Cayley\\Gremlin\\Vertex', $graph->vertex(['foo', 'bar']));
     $this->assertEquals('graph.Vertex("foo", "bar")', (string) $graph);
 }