Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/Rules/PHPUnit/TestMethodsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use PHPStan\Type\FileTypeMapper;
use PHPUnit\Framework\TestCase;
use function array_key_exists;
use function str_starts_with;
use function strpos;
use function strtolower;

final class TestMethodsHelper
Expand Down Expand Up @@ -62,7 +62,7 @@ public function getTestMethods(ClassReflection $classReflection, Scope $scope):
continue;
}

if (str_starts_with(strtolower($reflectionMethod->getName()), 'test')) {
if (strpos(strtolower($reflectionMethod->getName()), 'test') === 0) {
$testMethods[] = $reflectionMethod;
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Type/PHPUnit/DynamicCallToAssertionIgnoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPStan\Analyser\Scope;
use PHPUnit\Framework\TestCase;
use function is_string;
use function str_starts_with;
use function strpos;

final class DynamicCallToAssertionIgnoreExtension implements IgnoreErrorExtension
{
Expand All @@ -33,7 +33,7 @@ public function shouldIgnore(Error $error, Node $node, Scope $scope): bool

if (
!$node->name instanceof Node\Identifier
|| !str_starts_with($node->name->name, 'assert')
|| strpos($node->name->name, 'assert') !== 0
) {
return false;
}
Expand Down
Loading