public function setUp() { $this->client = $this->getMock('Everyman\\Neo4j\\Client', array(), array(), '', false); $this->path = new Path($this->client); $rel = new Relationship($this->client); $rel->setStartNode(new Node($this->client)); $rel->setEndNode(new Node($this->client)); $this->path->appendRelationship($rel); $this->rels[0] = $rel; $rel = new Relationship($this->client); $rel->setStartNode(new Node($this->client)); $rel->setEndNode(new Node($this->client)); $this->path->appendRelationship($rel); $this->rels[1] = $rel; $node = new Node($this->client); $this->path->appendNode($node); $this->nodes[0] = $node; $node = new Node($this->client); $this->path->appendNode($node); $this->nodes[1] = $node; $node = new Node($this->client); $this->path->appendNode($node); $this->nodes[2] = $node; $node = new Node($this->client); $this->path->appendNode($node); $this->nodes[3] = $node; }
public function testSaveRelationship_Create_NoType_ThrowsException() { $start = new Node($this->client); $start->setId(123); $end = new Node($this->client); $end->setId(456); $rel = new Relationship($this->client); $rel->setStartNode($start); $rel->setEndNode($end); $this->setExpectedException('Everyman\\Neo4j\\Exception'); $this->client->saveRelationship($rel); }
/** * Fill a relationship with data * * @param Relationship $rel * @param array $data * @return Relationship */ public function populateRelationship(Relationship $rel, $data) { $rel->useLazyLoad(false); $rel->setProperties($data['data']); $rel->setType($data['type']); $rel->setStartNode($this->getNodeFromUri($data['start'])); $rel->setEndNode($this->getNodeFromUri($data['end'])); return $rel; }