/** * Find paths from this node to the given node * * @param Node $to * @param string $type * @param string $dir * @return PathFinder */ public function findPathsTo(Node $to, $type = null, $dir = null) { $finder = new PathFinder($this->client); $finder->setStartNode($this); $finder->setEndNode($to); if ($dir) { $finder->setDirection($dir); } if ($type) { $finder->setType($type); } return $finder; }
public function testGetPaths_TransportFails_ThrowsException() { $startNode = new Node($this->client); $startNode->setId(123); $endNode = new Node($this->client); $endNode->setId(456); $finder = new PathFinder($this->client); $finder->setType('FOOTYPE')->setDirection(Relationship::DirectionOut)->setMaxDepth(3)->setStartNode($startNode)->setEndNode($endNode); $this->transport->expects($this->any())->method('post')->will($this->returnValue(array('code' => 400))); $this->setExpectedException('\\Everyman\\Neo4j\\Exception'); $this->client->getPaths($finder); }