Skip to content

Fix the tests running the extension without the container#484

Merged
VincentLanglet merged 1 commit intophpstan:2.0.xfrom
stof:rename_test
Apr 22, 2026
Merged

Fix the tests running the extension without the container#484
VincentLanglet merged 1 commit intophpstan:2.0.xfrom
stof:rename_test

Conversation

@stof
Copy link
Copy Markdown
Contributor

@stof stof commented Apr 22, 2026

PHPunit expects test classes to have a Test suffix in their name by default. Other classes are not loaded (considering they are utilities or fixtures for the tests instead).

PHPunit expects test classes to have a `Test` suffix in their name by
default. Other classes are not loaded (considering they are utilities or
fixtures for the tests instead).
}

yield from $this->gatherAssertTypes(__DIR__ . '/data/ExampleController.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/ExampleControllerWithoutContainer.php');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those were using the files defining assertions with precise container-based types instead of the dedicated assertions. This was not caught because the test never actually ran due to the class name not making it a test class.

@VincentLanglet VincentLanglet merged commit 6915dfe into phpstan:2.0.x Apr 22, 2026
43 checks passed
@VincentLanglet
Copy link
Copy Markdown
Contributor

Thanks

@stof stof deleted the rename_test branch April 22, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants