File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -144,18 +144,25 @@ public function testDefaultCommands() : void
144144
145145 public function testCommands () : void
146146 {
147- $ command = new class ($ this ->console ) extends CommandMock {
148- protected string $ name = 'test ' ;
149- protected bool $ active = false ;
150- };
151- $ this ->console ->addCommand ($ command );
152- self ::assertNull ($ this ->console ->getCommand ('test ' ));
153147 $ command = new CommandMock ($ this ->console );
154148 $ this ->console ->addCommands ([$ command ]);
155149 self ::assertNotEmpty ($ this ->console ->getCommands ());
156150 self ::assertInstanceOf (Command::class, $ this ->console ->getCommand ('test ' ));
157151 }
158152
153+ public function testInactiveCommand () : void
154+ {
155+ $ inactiveCommand = new class ($ this ->console ) extends CommandMock {
156+ protected string $ name = 'foo ' ;
157+ protected bool $ active = false ;
158+ };
159+ $ this ->console ->addCommand ($ inactiveCommand );
160+ self ::assertNull ($ this ->console ->getCommand ('foo ' ));
161+ foreach ($ this ->console ->getCommands () as $ command ) {
162+ self ::assertNotSame ($ inactiveCommand , $ command );
163+ }
164+ }
165+
159166 public function testRemoveCommands () : void
160167 {
161168 self ::assertNotNull ($ this ->console ->getCommand ('about ' ));
You can’t perform that action at this time.
0 commit comments