Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions rules/PHPUnit90/Rector/MethodCall/AssertRegExpRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading