Skip to content

Commit 18a66a7

Browse files
committed
Add disabled root menu exception test
1 parent 84ed66c commit 18a66a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/CliMenuBuilderTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,14 @@ public function testDisableDefaultItemsDisablesExitAndGoBackOnSubMenu()
371371

372372
$this->checkVariable($subMenu, 'items', []);
373373
}
374+
375+
public function testThrowsExceptionWhenDisablingRootMenu()
376+
{
377+
$this->expectException(\InvalidArgumentException::class);
378+
$this->expectExceptionMessage('You can\'t disable the root menu');
379+
380+
(new CliMenuBuilder)->disableMenu();
381+
}
374382

375383
/**
376384
* @param CliMenu $menu

0 commit comments

Comments
 (0)