Extend AddDoesNotPerformAssertionToNonAssertingTestRector by ca… (#2645)

Extend AddDoesNotPerformAssertionToNonAssertingTestRector by catching more test messages
This commit is contained in:
Tomas Votruba 2020-01-12 00:00:07 +01:00 committed by GitHub
commit 0ea5e8df5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ PHP
}
// A. try "->assert" shallow search first for performance
$hasDirectAssertCall = (bool) $this->hasDirectAssertCall($classMethod);
$hasDirectAssertCall = $this->hasDirectAssertCall($classMethod);
if ($hasDirectAssertCall) {
$this->containsAssertCallByClassMethod[$cacheHash] = $hasDirectAssertCall;
return $hasDirectAssertCall;
@ -187,7 +187,18 @@ PHP
return false;
}
return $this->isNames($node->name, ['assert*', 'expectException*', 'setExpectedException*']);
return $this->isNames($node->name, [
// prophecy
'should*',
'should',
'expect*',
'expect',
// phpunit
'*assert',
'assert*',
'expectException*',
'setExpectedException*',
]);
});
}