Fix FileSystem tests on Windows

This commit is contained in:
WouterJ 2015-12-12 16:57:50 +01:00
parent c2cad23357
commit c376cf3e06

View File

@ -868,7 +868,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
public function testMirrorCopiesLinkedDirectoryContents() public function testMirrorCopiesLinkedDirectoryContents()
{ {
$this->markAsSkippedIfSymlinkIsMissing(); $this->markAsSkippedIfSymlinkIsMissing(true);
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; $sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR;
@ -888,7 +888,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
public function testMirrorCopiesRelativeLinkedContents() public function testMirrorCopiesRelativeLinkedContents()
{ {
$this->markAsSkippedIfSymlinkIsMissing(); $this->markAsSkippedIfSymlinkIsMissing(true);
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; $sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR;
$oldPath = getcwd(); $oldPath = getcwd();
@ -1012,7 +1012,10 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
$this->markTestSkipped('Unable to retrieve file group name'); $this->markTestSkipped('Unable to retrieve file group name');
} }
private function markAsSkippedIfSymlinkIsMissing() /**
* @param bool $relative Whether support for relative symlinks is required
*/
private function markAsSkippedIfSymlinkIsMissing($relative = false)
{ {
if (!function_exists('symlink')) { if (!function_exists('symlink')) {
$this->markTestSkipped('symlink is not supported'); $this->markTestSkipped('symlink is not supported');
@ -1021,6 +1024,11 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
if (false === self::$symlinkOnWindows) { if (false === self::$symlinkOnWindows) {
$this->markTestSkipped('symlink requires "Create symbolic links" privilege on Windows'); $this->markTestSkipped('symlink requires "Create symbolic links" privilege on Windows');
} }
// https://bugs.php.net/bug.php?id=69473
if ($relative && '\\' === DIRECTORY_SEPARATOR && 1 === PHP_ZTS) {
$this->markTestSkipped('symlink does not support relative paths on thread safe Windows PHP versions');
}
} }
private function markAsSkippedIfChmodIsMissing() private function markAsSkippedIfChmodIsMissing()