Skip to content

Commit

Permalink
tests(console): add $extendCommands to runCommand of trait Tests\Cons…
Browse files Browse the repository at this point in the history
…ole\BaseCommand
  • Loading branch information
doyouhaobaby committed Oct 23, 2020
1 parent d447693 commit 258faed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/Console/BaseCommand.php
Expand Up @@ -32,7 +32,7 @@
*/
trait BaseCommand
{
protected function runCommand(Command $command, array $inputs, Closure $call)
protected function runCommand(Command $command, array $inputs, Closure $call, array $extendCommands = [])
{
$container = Container::singletons();
$container->clear();
Expand All @@ -41,6 +41,9 @@ protected function runCommand(Command $command, array $inputs, Closure $call)
$application->setAutoExit(false);
call_user_func($call, $container, $application);
$application->add($command);
foreach ($extendCommands as $v) {
$application->add($v);
}

$input = new ArrayInput($inputs);
$output = new BufferedOutput();
Expand Down

0 comments on commit 258faed

Please sign in to comment.