diff --git a/src/Framework/Features/BuildTasks/BuildTask.php b/src/Framework/Features/BuildTasks/BuildTask.php index 76a50aa3..72b491ae 100644 --- a/src/Framework/Features/BuildTasks/BuildTask.php +++ b/src/Framework/Features/BuildTasks/BuildTask.php @@ -50,11 +50,11 @@ public function run(?OutputStyle $output = null): int $this->printFinishMessage(); } catch (Throwable $exception) { if ($exception instanceof BuildTaskSkippedException) { - $this->writeln('Skipped'); - $this->writeln(" > {$exception->getMessage()}"); + $this->write("Skipped\n"); + $this->write(" > {$exception->getMessage()}"); } else { - $this->writeln('Failed'); - $this->writeln("{$exception->getMessage()}"); + $this->write("Failed\n"); + $this->write("{$exception->getMessage()}"); } $this->exitCode = $exception->getCode(); diff --git a/tests/Unit/BuildTaskUnitTest.php b/tests/Unit/BuildTaskUnitTest.php index 1a0d540c..4b484cf2 100644 --- a/tests/Unit/BuildTaskUnitTest.php +++ b/tests/Unit/BuildTaskUnitTest.php @@ -193,7 +193,7 @@ public function testTaskSkipping() }); $this->assertSame(0, $task->property('exitCode')); - $this->assertSame('Skipped', $task->buffer[1]); + $this->assertSame('Skipped', trim($task->buffer[1])); $this->assertSame(' > Task was skipped', $task->buffer[2]); } @@ -206,7 +206,7 @@ public function testTaskSkippingWithCustomMessage() }); $this->assertSame(0, $task->property('exitCode')); - $this->assertSame('Skipped', $task->buffer[1]); + $this->assertSame('Skipped', trim($task->buffer[1])); $this->assertSame(' > Custom reason', $task->buffer[2]); } @@ -221,7 +221,7 @@ public function testExceptionHandling() $task->run(); $this->assertSame(123, $task->property('exitCode')); - $this->assertSame('Failed', $task->buffer[1]); + $this->assertSame('Failed', trim($task->buffer[1])); $this->assertSame('Test exception', $task->buffer[2]); } }