fix: ignore line endings in console output assertions

This commit is contained in:
dualfroz committed 2026-10-02 16:20:09 +02:00
1 parent e8fb94b682
commit 50c16b7998
3 files changed
+26 -1

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Spiral\Testing\Tests\App\Command;
use Spiral\Console\Command;
final class MultilineCommand extends Command
{
protected const NAME = 'multiline';
public function perform(): int
{
$this->writeln('first line');
$this->writeln('second line');
return self::SUCCESS;
}
}
+5
View File
@@ -20,4 +20,9 @@ final class ConsoleTest extends TestCase
$this->assertCommandRegistered('bar');
}
public function testCommandOutputContainsStringsIgnoringLineEndings(): void
{
$this->assertConsoleCommandOutputContainsStrings('multiline', strings: "first line\r\nsecond line");
}
}