diff --git a/rules/PHPUnit90/Rector/MethodCall/AssertRegExpRector.php b/rules/PHPUnit90/Rector/MethodCall/AssertRegExpRector.php index ead35169..241a45f2 100644 --- a/rules/PHPUnit90/Rector/MethodCall/AssertRegExpRector.php +++ b/rules/PHPUnit90/Rector/MethodCall/AssertRegExpRector.php @@ -97,6 +97,14 @@ public function refactor(Node $node): ?Node continue; } + // cheap name gate before the costly TestCase type resolution below + if (! $this->isNames( + $stmt->expr->name, + [self::ASSERT_SAME, self::ASSERT_EQUALS, self::ASSERT_NOT_SAME, self::ASSERT_NOT_EQUALS] + )) { + continue; + } + if (! $this->testsNodeAnalyzer->isPHPUnitMethodCallNames( $stmt->expr, [self::ASSERT_SAME, self::ASSERT_EQUALS, self::ASSERT_NOT_SAME, self::ASSERT_NOT_EQUALS]