1
0
Fork 0

Fix __DIR__/getcwd() inconsistency.

pull/5991/head
AnrDaemon 2016-12-23 21:57:00 +03:00
parent 4896d16817
commit 810e70d234
1 changed files with 6 additions and 2 deletions

View File

@ -96,8 +96,12 @@ class PathRepositoryTest extends TestCase
$loader = new ArrayLoader(new VersionParser()); $loader = new ArrayLoader(new VersionParser());
$versionGuesser = null; $versionGuesser = null;
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'with-version')); // realpath() does not fully expand the paths
$relativeUrl = ltrim(substr($repositoryUrl, strlen(getcwd())), DIRECTORY_SEPARATOR); // PHP Bug https://bugs.php.net/bug.php?id=72642
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(realpath(realpath(__DIR__)), 'Fixtures', 'path', 'with-version'));
// getcwd() not necessarily match __DIR__
// PHP Bug https://bugs.php.net/bug.php?id=73797
$relativeUrl = ltrim(substr($repositoryUrl, strlen(realpath(realpath(getcwd())))), DIRECTORY_SEPARATOR);
$repository = new PathRepository(array('url' => $relativeUrl), $ioInterface, $config, $loader); $repository = new PathRepository(array('url' => $relativeUrl), $ioInterface, $config, $loader);
$packages = $repository->getPackages(); $packages = $repository->getPackages();