New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The PestAdapter builds the PHPUnit configuration with the pest version instead of the PHPUnit version #1795
Comments
I see two posible solutions, maybe you have some more as maintainer ;)
|
I see the bug. However, I don't think changing the very base interface ( The third alternative solution I had in my mind after some thinking is to update infection/src/TestFramework/PhpUnit/Adapter/PestAdapter.php Lines 103 to 106 in a222e75
For example first time it's called - return Pest version (to be displayed on console), second time it's called - return underlying PHPUnit version, to build configuration file. It's dirty and hacky, however requires no changes in abstract files, which are really not needed for any test frameworks except Pest. |
@maks-rafalko why no returning a combination within |
Because we need to display Pest version on terminal when Infection is executed
and we need to use PHPUnit version in our code, when deciding whether to use new PHPUnit features or not. infection/src/TestFramework/PhpUnit/Config/Builder/InitialConfigBuilder.php Lines 112 to 131 in 8042277
So in different cases we need different versions (Pest, PHPUnit). |
I don't feel it's a problem to show:
For the config builder it's harder to test, but I imagine we could actually have a PestConfigBuilder than can parse the PHPUnit version from the string and then leverage the PHPUnit builder? |
I am running infection with the test runner
pestphp/pest
. While I was looking for a strange behaivor I could find a small (not intended?) bug. The PestAdapter uses the pest version instead of the PHPUnit version to create the phpunit config files.The partial stacktrace should be a prove
This will result in calling
pest --version
with the output:an results into
1.22.3
wich is totaly correct, but not usable for the MutationConfigBuilder.TLDR: The configuration for a unit test will not include any PHPUnit Version related configuration adjustments like enabling result cache, set the execution order etc.
Let me know if i have to share more informations
The text was updated successfully, but these errors were encountered: