Skip to content

Commit fb40fd2

Browse files
committed
Stop parent lifecycle walk at PHPUnit and Symfony base test cases
1 parent 48bc372 commit fb40fd2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/NodeAnalyzer/LifecycleMethodAssertAnalyzer.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ private function isClassLikeAsserting(
108108
*/
109109
private function isParentClassAsserting(ClassReflection $classReflection, array $overriddenHookMethodNames): bool
110110
{
111-
// do not analyze PHPUnit itself
112-
if ($classReflection->getName() === PHPUnitClassName::TEST_CASE) {
111+
// do not analyze PHPUnit and Symfony base test cases, their hooks do not count as test assertions
112+
if (in_array($classReflection->getName(), PHPUnitClassName::FRAMEWORK_TEST_CASES, true)) {
113113
return false;
114114
}
115115

0 commit comments

Comments
 (0)