Ejemplo n.º 1
0
 public function testLeafRouteTreeNode()
 {
     $matcher = $this->mock(AbstractMatcher::class);
     $contents = new MatchedRouteDataMap();
     $node = new RouteTreeNode([$matcher], $contents);
     $this->assertSame([$matcher], $node->getMatchers());
     $this->assertSame($matcher, $node->getFirstMatcher());
     $this->assertSame($contents, $node->getContents());
     $this->assertTrue($node->isLeafNode());
     $this->assertFalse($node->isParentNode());
 }
 /**
  * @param \Viserio\Routing\Generator\RouteTreeNode $node
  */
 public function addChild(RouteTreeNode $node)
 {
     $hash = $node->getFirstMatcher()->getHash();
     $this->children[$hash] = $node;
 }