-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
The following TestCase will cause PHPStan to report a false positive.
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
/**
* @phpstan-return non-empty-string
*/
function someFunction(): string {
return '10';
}
final class MyTest extends TestCase {
public function testGeneration(): void {
self::assertIsNotNumeric(
someFunction(),
'This expectation message is misinterpreted as the "actual" param.'
);
}
}
The false positive:
Call to static method PHPUnit\Framework\Assert::assertIsNotNumeric() with non-empty-string and 'This expectation…' will always evaluate to true.
Metadata
Metadata
Assignees
Labels
No labels