mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
fix: discovering phpunit tests on parallel
This commit is contained in:
@ -128,6 +128,27 @@ final class TestSuiteLoader
|
||||
}
|
||||
}
|
||||
|
||||
if (! $testCaseFound) {
|
||||
foreach (array_reverse($loadedClasses) as $loadedClass) {
|
||||
$offset = 0 - strlen($suiteClassName);
|
||||
|
||||
if (stripos(substr($loadedClass, $offset - 1), '\\'.$suiteClassName) === 0 ||
|
||||
stripos(substr($loadedClass, $offset - 1), '_'.$suiteClassName) === 0) {
|
||||
try {
|
||||
$class = new ReflectionClass($loadedClass);
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (ReflectionException) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$suiteClassName = $loadedClass;
|
||||
$testCaseFound = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $testCaseFound) {
|
||||
return $this->exceptionFor($suiteClassName, $suiteClassFile);
|
||||
}
|
||||
|
||||
@ -15,6 +15,6 @@ $run = function () {
|
||||
};
|
||||
|
||||
test('parallel', function () use ($run) {
|
||||
expect($run())->toContain('Tests: 4 incomplete, 4 todos, 15 skipped, 626 passed (1550 assertions)')
|
||||
expect($run())->toContain('Tests: 4 incomplete, 4 todos, 15 skipped, 627 passed (1551 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user