8000 Fix FileSystem tests on Windows · symfony/symfony@c376cf3 · GitHub
[go: up one dir, main page]

Skip to content

Commit c376cf3

Browse files
committed
Fix FileSystem tests on Windows
1 parent c2cad23 commit c376cf3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ public function testMirrorCopiesLinks()
868868

869869
public function testMirrorCopiesLinkedDirectoryContents()
870870
{
871-
$this->markAsSkippedIfSymlinkIsMissing();
871+
$this->markAsSkippedIfSymlinkIsMissing(true);
872872

873873
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR;
874874

@@ -888,7 +888,7 @@ public function testMirrorCopiesLinkedDirectoryContents()
888888

889889
public function testMirrorCopiesRelativeLinkedContents()
890890
{
891-
$this->markAsSkippedIfSymlinkIsMissing();
891+
$this->markAsSkippedIfSymlinkIsMissing(true);
892892

893893
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR;
894894
$oldPath = getcwd();
@@ -1012,7 +1012,10 @@ private function getFileGroup($filepath)
10121012
$this->markTestSkipped('Unable to retrieve file group name');
10131013
}
10141014

1015-
private function markAsSkippedIfSymlinkIsMissing()
1015+
/**
1016+
* @param bool $relative Whether support for relative symlinks is required
1017+
*/
1018+
private function markAsSkippedIfSymlinkIsMissing($relative = false)
10161019
{
10171020
if (!function_exists('symlink')) {
10181021
$this->markTestSkipped('symlink is not supported');
@@ -1021,6 +1024,11 @@ private function markAsSkippedIfSymlinkIsMissing()
10211024
if (false === self::$symlinkOnWindows) {
10221025
$this->markTestSkipped('symlink requires "Create symbolic links" privilege on Windows');
10231026
}
1027+
1028+
// https://bugs.php.net/bug.php?id=69473
1029+
if ($relative && '\\' === DIRECTORY_SEPARATOR && 1 === PHP_ZTS) {
1030+
$this->markTestSkipped('symlink does not support relative paths on thread safe Windows PHP versions');
1031+
}
10241032
}
10251033

10261034
private function markAsSkippedIfChmodIsMissing()

0 commit comments

Comments
 (0)
0