We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be4761b commit 6ca33abCopy full SHA for 6ca33ab
src/Commands.php
@@ -28,6 +28,7 @@ public function addCommand(Command $command)
28
29
public function parse($arguments = null)
30
{
31
+ $this->command = null;
32
parent::parse($arguments);
33
34
if (count($this->getOperands()) > 0) {
tests/Commands/ParseTest.php
@@ -76,4 +76,15 @@ public function testStoresTheCalledCommand()
76
77
self::assertSame($command, $commands->getCommand());
78
}
79
+
80
+ public function testResetsTheCommand()
81
+ {
82
+ $commands = new Commands();
83
+ $commands->addCommand(new Command('help', 'Show the help for command', 'var_dump'));
84
+ $commands->parse('help');
85
86
+ $commands->parse('');
87
88
+ self::assertNull($commands->getCommand());
89
+ }
90
0 commit comments