Get root path from already available and correct path of autoloader

This commit is contained in:
NickSdot
2020-10-14 21:31:28 +08:00
parent d1b61a34de
commit 13a8aee049

View File

@ -19,13 +19,16 @@ use Symfony\Component\Console\Output\OutputInterface;
if (file_exists($vendorPath)) { if (file_exists($vendorPath)) {
include_once $vendorPath; include_once $vendorPath;
$rootPath = dirname($vendorPath, 2);
} else { } else {
include_once $localPath; include_once $localPath;
$rootPath = dirname($localPath, 5);
} }
(new Provider())->register(); (new Provider())->register();
$rootPath = getcwd(); // fallback in case we couldn't find out the path before.
$rootPath = (isset($rootPath) && !empty($rootPath)) ? $rootPath : getcwd();
$testSuite = TestSuite::getInstance($rootPath); $testSuite = TestSuite::getInstance($rootPath);