From dd9bb5bead1dbeee7f05a1d9b6fe24ae8d5707e1 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 3 Jan 2023 12:27:42 +0000 Subject: [PATCH] fix: output for tool command to also contain error output --- app/Commands/ToolCommand.php | 3 ++- tests/Feature/FixCommandTest.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Commands/ToolCommand.php b/app/Commands/ToolCommand.php index 300fd50..2436bf8 100644 --- a/app/Commands/ToolCommand.php +++ b/app/Commands/ToolCommand.php @@ -119,7 +119,8 @@ private function process(array $command): array } } else { $taskSuccess = true; - $output = $process->getOutput(); + $output = $process->getErrorOutput(); + $output .= $process->getOutput(); } $this->newLine(); diff --git a/tests/Feature/FixCommandTest.php b/tests/Feature/FixCommandTest.php index 7175bc6..c356437 100755 --- a/tests/Feature/FixCommandTest.php +++ b/tests/Feature/FixCommandTest.php @@ -16,12 +16,12 @@ it('works', function () { $this->artisan('fix') - ->expectsOutputToContain('Fixed all files') + ->expectsOutputToContain('stickee') ->assertExitCode(0); }); it('allows passing options', function () { - $this->artisan('fix --dry-run') - ->expectsOutputToContain('Checked all files') + $this->artisan('fix -- --dry-run --verbose') + ->expectsOutputToContain('Legend:') ->assertExitCode(0); });