Skip to content

Commit

Permalink
minor #54387 [Filesystem]  fix tests on Windows (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 7.1 branch.

Discussion
----------

[Filesystem]  fix tests on Windows

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

Commits
-------

3dc9c4e fix tests on Windows
  • Loading branch information
fabpot committed Mar 25, 2024
2 parents 471bd06 + 3dc9c4e commit 78c6ceb
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 78c6ceb

Please sign in to comment.