File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace PhpSchool \CliMenuTest \MenuItem ;
4
4
5
+ use PhpSchool \CliMenu \CliMenu ;
5
6
use PhpSchool \CliMenu \MenuItem \CheckableItem ;
6
7
use PhpSchool \CliMenu \MenuStyle ;
7
8
use PhpSchool \Terminal \Terminal ;
@@ -16,6 +17,20 @@ public function testCanSelectIsTrue() : void
16
17
$ this ->assertTrue ($ item ->canSelect ());
17
18
}
18
19
20
+ public function testGetSelectAction () : void
21
+ {
22
+ $ callable = function () {
23
+ return 'callable is called ' ;
24
+ };
25
+ $ item = new CheckableItem ('Item ' , $ callable );
26
+
27
+ $ cliMenu = $ this ->getMockBuilder (CLiMenu::class)
28
+ ->disableOriginalConstructor ()
29
+ ->getMock ();
30
+
31
+ $ this ->assertSame ($ callable (), $ item ->getSelectAction ()($ cliMenu ));
32
+ }
33
+
19
34
public function testShowsItemExtra () : void
20
35
{
21
36
$ item = new CheckableItem ('Item ' , function () {
You can’t perform that action at this time.
0 commit comments