Skip to content

Commit

Permalink
Merge branch '10.5' into 11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 3, 2024
2 parents 6a17778 + 254085f commit 8661cec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/Runner/TestSuiteLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use function array_diff;
use function array_values;
use function basename;
use function class_exists;
use function get_declared_classes;
use function realpath;
use function str_ends_with;
Expand Down Expand Up @@ -79,11 +78,13 @@ public function load(string $suiteClassFile): ReflectionClass
throw $e;
}

if (!class_exists($suiteClassName)) {
throw new ClassCannotBeFoundException($suiteClassName, $suiteClassFile);
foreach ($loadedClasses as $className) {
if (str_ends_with(strtolower($className), strtolower($suiteClassName))) {
throw new ClassDoesNotExtendTestCaseException($className, $suiteClassFile);
}
}

throw new ClassDoesNotExtendTestCaseException($suiteClassName, $suiteClassFile);
throw new ClassCannotBeFoundException($suiteClassName, $suiteClassFile);
}

private function classNameFromFileName(string $suiteClassFile): string
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/regression/5364.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Time: %s, Memory: %s

There was 1 PHPUnit test runner warning:

1) Class BarTest cannot be found in %sBarTest.php
1) Class PHPUnit\TestFixture\Issue5364\BarTest declared in %sBarTest.php does not extend PHPUnit\Framework\TestCase

WARNINGS!
Tests: 1, Assertions: 1, Warnings: 1.

0 comments on commit 8661cec

Please sign in to comment.