Example #1
0
 /**
  * Walk along the successors line to get all versions of this node
  *
  * According to spec, 3.13.1.4, these are called eventual successors
  *
  * @param VersionInterface $node the node to get successors
  *      from
  *
  * @return array list of VersionInterface
  */
 protected function getEventualSuccessors($node)
 {
     $successors = $node->getSuccessors();
     $results = array();
     foreach ($successors as $successor) {
         $results[$successor->getName()] = $successor;
         // OPTIMIZE: use a stack instead of recursion
         $results = array_merge($results, $this->getEventualSuccessors($successor));
     }
     return $results;
 }
 public function testGetSuccessors()
 {
     $versions = $this->simpleVersioned->getSuccessors();
     $this->assertCount(0, $versions);
 }