Closed altdovydas closed 1 year ago
This bug report is missing a link to reproduction at phpstan.org/try.
It will most likely be closed after manual review.
This issue seems to be fixed in 1.3.14 while at the same time false positives are now reported for assertNotContains()
.
With 1.3.15, I cannot reproduce either of the issues. assertArrayHasKey()
and assertNotContains()
both seem to be understood correctly now.
Great, thank you :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Bug report
Tested with 1.9.11 - 1.9.17 PHP 8.1.10 PHPUnit 9.5.27
Code snippet that reproduces the problem
Result
Call to method PHPUnit\Framework\Assert::assertArrayHasKey() with 'test' and ArrayObject<string, bool> will always evaluate to false.
Expected output
OK
Code snippet with god results
Result
PHPUnit output:
Failed asserting that an array has the key 'test'.
PHPStan output:
Call to method PHPUnit\Framework\Assert::assertArrayHasKey() with 'test' and ArrayObject<int, string> will always evaluate to false.