8000 minor #54387 [Filesystem]  fix tests on Windows (xabbuh) · symfony/symfony@78c6ceb · GitHub
[go: up one dir, main page]

Skip to content

Commit 78c6ceb

Browse files
committed
minor #54387 [Filesystem]  fix tests on Windows (xabbuh)
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
2 parents 471bd06 + 3dc9c4e commit 78c6ceb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,15 +1812,15 @@ public function testReadFile()
18121812
public function testReadNonExistentFile()
18131813
{
18141814
$this->expectException(IOException::class);
1815-
$this->expectExceptionMessageMatches('#^Failed to read file ".+/Tests/invalid"\\: file_get_contents\\(.+/Tests/invalid\\)\\: Failed to open stream\\: No such file or directory$#');
1815+
$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)));
18161816

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

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

18251825
$this->filesystem->readFile(__DIR__);
18261826
}

0 commit comments

Comments
 (0)
0