mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Add baseline ignoring carriage return test.
This commit is contained in:
parent
350687dcb7
commit
793b8d34d8
@ -98,6 +98,37 @@ class ErrorBaselineTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testShouldIgnoreCarriageReturnInMultilineSnippets(): void
|
||||
{
|
||||
$baselineFilePath = 'baseline.xml';
|
||||
|
||||
$this->fileProvider->allows()->fileExists($baselineFilePath)->andReturns(true);
|
||||
$this->fileProvider->allows()->getContents($baselineFilePath)->andReturns(
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||
<files>
|
||||
<file src=\"sample/sample-file.php\">
|
||||
<MixedAssignment>
|
||||
<code>
|
||||
foo
|
||||
bar
|
||||
</code>
|
||||
</MixedAssignment>
|
||||
</file>
|
||||
</files>",
|
||||
);
|
||||
|
||||
$expectedParsedBaseline = [
|
||||
'sample/sample-file.php' => [
|
||||
'MixedAssignment' => ['o' => 1, 's' => ["foo\nbar"]],
|
||||
],
|
||||
];
|
||||
|
||||
$this->assertSame(
|
||||
$expectedParsedBaseline,
|
||||
ErrorBaseline::read($this->fileProvider, $baselineFilePath),
|
||||
);
|
||||
}
|
||||
|
||||
public function testLoadShouldThrowExceptionWhenFilesAreNotDefinedInBaselineFile(): void
|
||||
{
|
||||
$this->expectException(ConfigException::class);
|
||||
|
Loading…
x
Reference in New Issue
Block a user