isAncestor() public method

Checks whether an item is the ancestor of a current item.
public isAncestor ( Knp\Menu\ItemInterface $item, integer $depth = null ) : boolean
$item Knp\Menu\ItemInterface
$depth integer The max depth to look for the item
return boolean
Exemplo n.º 1
0
 public function testIsAncestor()
 {
     $menu = $this->getMock('Knp\\Menu\\ItemInterface');
     $matcherMock = $this->getMatcherMock();
     $matcherMock->expects($this->any())->method('isAncestor')->with($menu)->will($this->returnValue(false));
     $helper = new MenuHelper($this->getHelperMock(), $matcherMock, $this->getManipulatorMock());
     $this->assertFalse($helper->isAncestor($menu));
 }