Skip to content

Commit 69b75b9

Browse files
committed
fix tests on Windows
1 parent 4dd334e commit 69b75b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)