render() public method

Renders a menu with the specified renderer.
public render ( Knp\Menu\ItemInterface | string | array $menu, array $options = [], string $renderer = null ) : string
$menu Knp\Menu\ItemInterface | string | array
$options array
$renderer string
return string
Ejemplo n.º 1
0
 public function testRender()
 {
     $helperMock = $this->getHelperMock();
     $helperMock->expects($this->any())->method('render')->with($this->equalTo('test'), $this->equalTo(array('options')))->will($this->returnValue('returned value'));
     $helper = new MenuHelper($helperMock, $this->getMatcherMock(), $this->getManipulatorMock());
     $this->assertEquals('returned value', $helper->render('test', array('options')));
 }
Ejemplo n.º 2
0
 public function testRender()
 {
     $helperMock = $this->getMockBuilder('Knp\\Menu\\Twig\\Helper')->disableOriginalConstructor()->getMock();
     $helperMock->expects($this->once())->method('render')->with($this->equalTo('test'), $this->equalTo(array('options')))->will($this->returnValue('returned value'));
     $helper = new MenuHelper($helperMock);
     $this->assertEquals('returned value', $helper->render('test', array('options')));
 }
Ejemplo n.º 3
0
 /**
  * @param string $name
  * @param integer $depth (optional)
  * @return string
  */
 public function render($name, $depth = null, $template = null)
 {
     return $this->helper->render($name, $depth, $template);
 }