Skip to content

Commit

Permalink
fix tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Mar 24, 2024
1 parent b5ee977 commit 3dc9c4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
Expand Up @@ -1812,15 +1812,15 @@ public function testReadFile()
public function testReadNonExistentFile()
{
$this->expectException(IOException::class);
$this->expectExceptionMessageMatches('#^Failed to read file ".+/Tests/invalid"\\: file_get_contents\\(.+/Tests/invalid\\)\\: Failed to open stream\\: No such file or directory$#');
$this->expectExceptionMessageMatches(sprintf('#^Failed to read file ".+%1$sTests/invalid"\\: file_get_contents\\(.+%1$sTests/invalid\\)\\: Failed to open stream\\: No such file or directory$#', preg_quote(\DIRECTORY_SEPARATOR)));

$this->filesystem->readFile(__DIR__.'/invalid');
}

public function testReadDirectory()
{
$this->expectException(IOException::class);
$this->expectExceptionMessageMatches('#^Failed to read file ".+/Tests"\\: File is a directory\\.$#');
$this->expectExceptionMessageMatches(sprintf('#^Failed to read file ".+%sTests"\\: File is a directory\\.$#', preg_quote(\DIRECTORY_SEPARATOR)));

$this->filesystem->readFile(__DIR__);
}
Expand Down

0 comments on commit 3dc9c4e

Please sign in to comment.