Skip to content

Commit

Permalink
Fix broken symlink tests Windows PHP 7.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed May 31, 2023
1 parent 38d3a96 commit 0ce3a62
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Tests/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 0ce3a62

Please sign in to comment.