1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

symlink perms are not available by default under windows

This commit is contained in:
SignpostMarv 2019-02-06 19:20:33 +00:00 committed by Matthew Brown
parent 5c49dfd746
commit e587a80181

View File

@ -172,7 +172,25 @@ class ConfigTest extends TestCase
public function testIgnoreSymlinkedProjectDirectory()
{
@unlink(__DIR__ . '/symlinktest/ignored/b');
symlink(__DIR__ . '/symlinktest/a', __DIR__ . '/symlinktest/ignored/b');
$no_symlinking_error = 'symlink(): Cannot create symlink, error code(1314)';
$last_error = error_get_last();
$check_symlink_error =
! is_array($last_error) ||
! isset($last_error['message']) ||
$no_symlinking_error !== $last_error['message'];
@symlink(__DIR__ . '/symlinktest/a', __DIR__ . '/symlinktest/ignored/b');
if ($check_symlink_error) {
$last_error = error_get_last();
if (is_array($last_error) && isset($last_error['message']) && $no_symlinking_error === $last_error['message']) {
$this->markTestSkipped($no_symlinking_error);
return;
}
}
$this->project_analyzer = $this->getProjectAnalyzerWithConfig(
Config::loadFromXML(