示例#1
0
 /**
  * @param int $choice
  * @param string $person
  *
  * @return array|null $result
  */
 protected function getResult($choice, $person)
 {
     $result = null;
     switch ($choice) {
         case 0:
             $result = $this->friendRepository->getFriends($person);
             break;
         case 1:
             $result = $this->friendRepository->getFriendsOfFriends($person);
             break;
         case 2:
             $result = $this->friendRepository->getSuggestedFriends($person);
             break;
     }
     return $result;
 }
示例#2
0
 public function testGetFriendsOfFriends()
 {
     $person = 'Andrey';
     $result = $this->repository->getFriendsOfFriends($person);
     $this->assertEquals('match (person {firstName: \'Andrey\'})-[:FRIEND*2..2]-(friend) ' . 'WHERE NOT (person)-[:FRIEND]-(friend) AND person <> friend return distinct friend.firstName', $result);
 }