mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Fixes symlinked namespaces
This commit is contained in:
@ -122,6 +122,8 @@ final class TestCaseFactory
|
|||||||
$rootPath = TestSuite::getInstance()->rootPath;
|
$rootPath = TestSuite::getInstance()->rootPath;
|
||||||
$relativePath = str_replace($rootPath.DIRECTORY_SEPARATOR, '', $filename);
|
$relativePath = str_replace($rootPath.DIRECTORY_SEPARATOR, '', $filename);
|
||||||
|
|
||||||
|
$relativePath = ltrim($relativePath, DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
$basename = basename($relativePath, '.php');
|
$basename = basename($relativePath, '.php');
|
||||||
|
|
||||||
$dotPos = strpos($basename, '.');
|
$dotPos = strpos($basename, '.');
|
||||||
@ -208,7 +210,13 @@ final class TestCaseFactory
|
|||||||
|
|
||||||
eval($classCode);
|
eval($classCode);
|
||||||
} catch (ParseError $caught) {
|
} catch (ParseError $caught) {
|
||||||
throw new RuntimeException(sprintf('Unable to create test case for test file at %s', $filename), 1, $caught);
|
|
||||||
|
|
||||||
|
throw new RuntimeException(sprintf(
|
||||||
|
"Unable to create test case for test file at %s. \n %s",
|
||||||
|
$filename,
|
||||||
|
$classCode
|
||||||
|
), 1, $caught);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user