File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,31 @@ public function testGetSelectAction() : void
2424 };
2525 $ item = new CheckableItem ('Item ' , $ callable );
2626
27- $ cliMenu = $ this ->getMockBuilder (CLiMenu ::class)
27+ $ cliMenu = $ this ->getMockBuilder (CliMenu ::class)
2828 ->disableOriginalConstructor ()
2929 ->getMock ();
3030
3131 $ this ->assertSame ($ callable (), $ item ->getSelectAction ()($ cliMenu ));
3232 }
3333
34+ public function testSelectActionTogglesItem () : void
35+ {
36+ $ callable = function () {
37+ };
38+
39+ $ item = new CheckableItem ('Item ' , $ callable );
40+
41+ self ::assertFalse ($ item ->getChecked ());
42+
43+ $ cliMenu = $ this ->getMockBuilder (CliMenu::class)
44+ ->disableOriginalConstructor ()
45+ ->getMock ();
46+
47+ $ item ->getSelectAction ()($ cliMenu );
48+
49+ self ::assertTrue ($ item ->getChecked ());
50+ }
51+
3452 public function testShowsItemExtra () : void
3553 {
3654 $ item = new CheckableItem ('Item ' , function () {
You can’t perform that action at this time.
0 commit comments