Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filesystem]  fix tests on Windows #54387

Merged
merged 1 commit into from Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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