Knp\Bundle\MenuBundle\Templating\Helper\MenuHelper::isCurrent PHP Метод

isCurrent() публичный Метод

Checks whether an item is current.
public isCurrent ( Knp\Menu\ItemInterface $item ) : boolean
$item Knp\Menu\ItemInterface
Результат boolean
    public function isCurrent(ItemInterface $item)
    {
        return $this->matcher->isCurrent($item);
    }

Usage Example

Пример #1
0
 public function testIsCurrent()
 {
     $current = $this->getMock('Knp\\Menu\\ItemInterface');
     $notCurrent = $this->getMock('Knp\\Menu\\ItemInterface');
     $matcherMock = $this->getMatcherMock();
     $matcherMock->expects($this->any())->method('isCurrent')->withConsecutive(array($current), array($notCurrent))->will($this->onConsecutiveCalls(true, false));
     $helper = new MenuHelper($this->getHelperMock(), $matcherMock, $this->getManipulatorMock());
     $this->assertTrue($helper->isCurrent($current));
     $this->assertFalse($helper->isCurrent($notCurrent));
 }