Skip to content

Commit

Permalink
fix one assertEquals readlink() for 7.3.*
Browse files Browse the repository at this point in the history
  • Loading branch information
a1812 committed Apr 22, 2021
1 parent 6322456 commit 51a0b9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Filesystem/Filesystem.php
Expand Up @@ -423,7 +423,7 @@ public function readlink($path, $canonicalize = false)
return realpath($path);
}

if ('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70410) {
if ('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70400) {
return realpath($path);
}

Expand Down
8 changes: 6 additions & 2 deletions src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
Expand Up @@ -376,7 +376,7 @@ public function testRemoveCleansInvalidLinks()

// create symlink to nonexistent dir
rmdir($basePath.'dir');
$this->assertDirectoryDoesNotExist($basePath.'dir-link');
$this->assertFalse('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70400 ? @readlink($basePath.'dir-link') : is_dir($basePath.'dir-link'));

$this->filesystem->remove($basePath);

Expand Down Expand Up @@ -1032,7 +1032,11 @@ public function testReadAbsoluteLink()
$this->filesystem->symlink($link1, $link2);

$this->assertEquals($file, $this->filesystem->readlink($link1));
$this->assertEquals($link1, $this->filesystem->readlink($link2));

if ('\\' === \DIRECTORY_SEPARATOR && (\PHP_VERSION_ID < 70300 || \PHP_VERSION_ID > 70327)) {
$this->assertEquals($link1, $this->filesystem->readlink($link2));
}

$this->assertEquals($file, $this->filesystem->readlink($link1, true));
$this->assertEquals($file, $this->filesystem->readlink($link2, true));
$this->assertEquals($file, $this->filesystem->readlink($file, true));
Expand Down

0 comments on commit 51a0b9c

Please sign in to comment.