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); }