phpstan-phpunit icon indicating copy to clipboard operation
phpstan-phpunit copied to clipboard

PHPUnit extensions and rules for PHPStan

Results 40 phpstan-phpunit issues
Sort by recently updated
recently updated
newest added

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [nikic/php-parser](https://togithub.com/nikic/PHP-Parser) | `^4.13.0` -> `^5.0.0` | [![age](https://developer.mend.io/api/mc/badges/age/packagist/nikic%2fphp-parser/5.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)...

Hello, I've encountered a type inference issue when using PHPStan with PHPUnit assertions on a piece of code that utilizes named parameters. Given the following code snippet: `$data = $this->requestAndGetData(method:...

So, I am overriding tearDown() and as the rule suggests i need to call the parent::teardown() inside it , the only problem here is that i want to call it...

For large codebases (I'm looking into Drupal), it would be good to be able to define a target PHPUnit version, so that checks for later versions could be anticipated while...

After upgrading from phpstan 1.9 to 1.10, I started getting many errors like this: >Trying to mock an undefined method X on class Y". Downgrading to 1.9 solves the problems,...

Hello, I am building a test returning an array of entities to be used in some others tests marked with `@depends`. Despite I check that my returned array is not...

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Eomm/why-don-t-you-tweet](https://togithub.com/Eomm/why-don-t-you-tweet) | action | major | `v1` -> `v2` | ---...

Simplified reproducible example: ```php class AssertCountProblemTest extends TestCase { /** * @var list */ private static array $database = []; public function testFoo(): void { self::assertCount(0, $this->getDataFromDatabase()); self::editDataInDatabase(); $newData =...

This Pull Request enhances the AssertSameWithCountRule in PHPUnit to handle additional use cases. The new rule now checks when both sides of the assertSame are counts, and suggests assertSameSize instead...

Our automated updates updated to 1.3.16 today and started failing phpstan. Based on the [changes from 1.3.15 ](https://github.com/phpstan/phpstan-phpunit/compare/1.3.15...1.3.16) it's obvious what the issue is. Our tests do something like this:...