fix: ignore line endings in console output assertions
This commit is contained in:
1 parent
e8fb94b682
commit
50c16b7998
3 files changed
+26
-1
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user