From 0ce3a62c9579a53358d3a7eb6b3dfb79789a6364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Wed, 31 May 2023 15:04:02 +0200 Subject: [PATCH] Fix broken symlink tests Windows PHP 7.4+ --- Tests/FilesystemTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Tests/FilesystemTest.php b/Tests/FilesystemTest.php index 252635bc9..7280d5135 100644 --- a/Tests/FilesystemTest.php +++ b/Tests/FilesystemTest.php @@ -13,6 +13,7 @@ use Symfony\Component\Filesystem\Exception\InvalidArgumentException; use Symfony\Component\Filesystem\Exception\IOException; +use Symfony\Component\Filesystem\Path; /** * Test class for Filesystem. @@ -1095,18 +1096,18 @@ public function testReadBrokenLink() $this->markTestSkipped('Windows does not support reading "broken" symlinks in PHP < 7.4.0'); } - $file = $this->workspace.'/file'; - $link = $this->workspace.'/link'; + $file = Path::join($this->workspace, 'file'); + $link = Path::join($this->workspace, 'link'); touch($file); $this->filesystem->symlink($file, $link); $this->filesystem->remove($file); - $this->assertEquals($file, $this->filesystem->readlink($link)); + $this->assertEquals($file, Path::normalize($this->filesystem->readlink($link))); $this->assertNull($this->filesystem->readlink($link, true)); touch($file); - $this->assertEquals($file, $this->filesystem->readlink($link, true)); + $this->assertEquals($file, Path::normalize($this->filesystem->readlink($link, true))); } public function testReadLinkDefaultPathDoesNotExist()