diff options
Diffstat (limited to 'plugins/TestRunner/Commands/TestsSetupFixture.php')
-rw-r--r-- | plugins/TestRunner/Commands/TestsSetupFixture.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/TestRunner/Commands/TestsSetupFixture.php b/plugins/TestRunner/Commands/TestsSetupFixture.php index 565a81122a..9e6a541e1e 100644 --- a/plugins/TestRunner/Commands/TestsSetupFixture.php +++ b/plugins/TestRunner/Commands/TestsSetupFixture.php @@ -157,7 +157,13 @@ class TestsSetupFixture extends ConsoleCommand foreach (array('libs', 'plugins', 'tests', 'misc', 'piwik.js') as $linkName) { $linkPath = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/' . $linkName; if (!file_exists($linkPath)) { - symlink(PIWIK_INCLUDE_PATH . '/' . $linkName, $linkPath); + $success = @symlink($target, $linkPath); + // setting symlink might fail when the symlink already exists but pointing to a no longer existing path/file + // eg when sometimes running it on a VM and sometimes on the VM's host itself. + if (!$success) { + unlink($target); + symlink($target, $linkPath); + } } } } |