From 7fd6f5326b66b00f4be742ad6c210c62e0731c03 Mon Sep 17 00:00:00 2001 From: Joseph Silber Date: Tue, 4 Sep 2018 12:13:58 -0400 Subject: [PATCH] Support console testing in Laravel 5.7 --- tests/Concerns/TestsConsoleCommands.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Concerns/TestsConsoleCommands.php b/tests/Concerns/TestsConsoleCommands.php index 618047e..a90c417 100644 --- a/tests/Concerns/TestsConsoleCommands.php +++ b/tests/Concerns/TestsConsoleCommands.php @@ -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; @@ -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; }