PhpSchool\CliMenu\MenuItem\MenuMenuItem::showSubMenu PHP Метод

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

Display the sub menu
public showSubMenu ( CliMenu $parentMenu )
$parentMenu PhpSchool\CliMenu\CliMenu
    public function showSubMenu(CliMenu $parentMenu)
    {
        $parentMenu->closeThis();
        $this->subMenu->open();
    }

Usage Example

Пример #1
0
 public function testShowSubMenu()
 {
     $mainMenu = $this->getMockBuilder(CliMenu::class)->disableOriginalConstructor()->getMock();
     $subMenu = $this->getMockBuilder(CliMenu::class)->disableOriginalConstructor()->getMock();
     $mainMenu->expects($this->once())->method('closeThis');
     $subMenu->expects($this->once())->method('open');
     $item = new MenuMenuItem('Item', $subMenu);
     $item->showSubMenu($mainMenu);
 }