diff --git a/src/Illuminate/Foundation/Testing/PendingCommand.php b/src/Illuminate/Foundation/Testing/PendingCommand.php index 81615954e8c7..79f9ce4fb718 100644 --- a/src/Illuminate/Foundation/Testing/PendingCommand.php +++ b/src/Illuminate/Foundation/Testing/PendingCommand.php @@ -131,10 +131,10 @@ public function run() { $this->hasExecuted = true; - $this->mockConsoleOutput(); + $mock = $this->mockConsoleOutput(); try { - $exitCode = $this->app[Kernel::class]->call($this->command, $this->parameters); + $exitCode = $this->app[Kernel::class]->call($this->command, $this->parameters, $mock); } catch (NoMatchingExpectationException $e) { if ($e->getMethodName() === 'askQuestion') { $this->test->fail('Unexpected question "'.$e->getActualArguments()[0]->getQuestion().'" was asked.'); @@ -156,7 +156,7 @@ public function run() /** * Mock the application's console output. * - * @return void + * @return \Mockery\MockInterface */ protected function mockConsoleOutput() { @@ -181,6 +181,8 @@ protected function mockConsoleOutput() $this->app->bind(OutputStyle::class, function () use ($mock) { return $mock; }); + + return $mock; } /**