fix misleading error message with test class

This commit is contained in:
Will Rossiter 2022-11-25 09:13:08 +13:00 committed by GitHub
parent 20582936d8
commit 1354edf054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -215,9 +215,10 @@ class FixtureTestState implements TestState
*/
protected function getTestAbsolutePath(SapphireTest $test)
{
$filename = ClassLoader::inst()->getItemPath(get_class($test));
$class = get_class($test);
$filename = ClassLoader::inst()->getItemPath($class);
if (!$filename) {
throw new LogicException('getItemPath returned null for ' . static::class
throw new LogicException('getItemPath returned null for ' . $class
. '. Try adding flush=1 to the test run.');
}
return dirname($filename ?? '');