コード例 #1
0
 public function testBuildMenu()
 {
     $child = $this->getMock('\\Knp\\Menu\\ItemInterface');
     /* @var $item \PHPUnit_Framework_MockObject_MockObject|ItemInterface */
     $item = $this->getMock('\\Knp\\Menu\\ItemInterface');
     $item->expects($this->once())->method('addChild')->will($this->returnValue($child))->with('foo', ['route' => 'fill_filler', 'routeParameters' => ['plugin' => 'bar']]);
     $this->filler->expects($this->once())->method('getTitle')->will($this->returnValue('foo'));
     $this->filler->expects($this->once())->method('getName')->will($this->returnValue('bar'));
     $this->assertEquals($child, $this->filler->buildMenu($item));
 }
コード例 #2
0
 /**
  * Build menu for plugin.
  *
  * @param ItemInterface $item
  *
  * @return ItemInterface
  */
 public function buildMenu(ItemInterface $item)
 {
     return parent::buildMenu($item)->setLinkAttribute('class', 'icon-label icon-label-plugin-anidb');
 }