get() public method

Retrieves an item following a path in the tree.
public get ( Knp\Menu\ItemInterface | string $menu, array $path = [], array $options = [] ) : Knp\Menu\ItemInterface
$menu Knp\Menu\ItemInterface | string
$path array
$options array
return Knp\Menu\ItemInterface
 public function testGetMenuWithOptions()
 {
     $menu = $this->getMock('Knp\\Menu\\ItemInterface');
     $helperMock = $this->getHelperMock();
     $helperMock->expects($this->any())->method('get')->with('default', array(), array('foo' => 'bar'))->will($this->returnValue($menu));
     $helper = new MenuHelper($helperMock, $this->getMatcherMock(), $this->getManipulatorMock());
     $this->assertSame($menu, $helper->get('default', array(), array('foo' => 'bar')));
 }
 public function testGetMenuWithOptions()
 {
     $menu = $this->getMock('Knp\\Menu\\ItemInterface');
     $helperMock = $this->getMockBuilder('Knp\\Menu\\Twig\\Helper')->disableOriginalConstructor()->getMock();
     $helperMock->expects($this->once())->method('get')->with('default', array(), array('foo' => 'bar'))->will($this->returnValue($menu));
     $helper = new MenuHelper($helperMock);
     $this->assertSame($menu, $helper->get('default', array(), array('foo' => 'bar')));
 }
 /**
  * @param string $name
  * @return \Knp\Bundle\MenuBundle\Menu
  * @throws \InvalidArgumentException
  */
 public function get($name)
 {
     return $this->helper->get($name);
 }