Skip to content

Commit

Permalink
Support console testing in Laravel 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephSilber committed Sep 4, 2018
1 parent 98612ba commit 7fd6f53
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/Concerns/TestsConsoleCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Prophecy\Argument;
use Illuminate\Console\Command;
use Illuminate\Console\OutputStyle;
use Prophecy\Prophecy\ObjectProphecy;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
Expand All @@ -25,6 +26,12 @@ protected function laravel()
$command->{$method}();
});

$laravel->make(OutputStyle::class, Argument::type('array'))->will(function ($arguments) {
list($class, $arguments) = $arguments;

return new $class($arguments['input'], $arguments['output']);
});

return $laravel;
}

Expand Down

0 comments on commit 7fd6f53

Please sign in to comment.