getCurrentItem() public method

Returns the current item of a menu.
public getCurrentItem ( Knp\Menu\ItemInterface | array | string $menu ) : Knp\Menu\ItemInterface | null
$menu Knp\Menu\ItemInterface | array | string
return Knp\Menu\ItemInterface | null
コード例 #1
0
 public function testGetCurrentItem()
 {
     $menu = $this->getMock('Knp\\Menu\\ItemInterface');
     $helperMock = $this->getHelperMock(array('getCurrentItem'));
     $helperMock->expects($this->any())->method('getCurrentItem')->with('default')->will($this->returnValue($menu));
     $helper = new MenuHelper($helperMock, $this->getMatcherMock(), $this->getManipulatorMock());
     $this->assertEquals($menu, $helper->getCurrentItem('default'));
 }