Testing Rector rules and PHPStan rules in the same test suite #8975
|
Hello, we have a package which provides PHPStan and Rector rules. Those are tested thanks to PHPUnit, each tests are passing individually, but they are failing when we run the full testsuite: I guess this is because Rector ships its own vendors, and Is there any solution for this, beside to split into two testsuites? FYI We have the same problem using both phpstan and rector v1 or v2 thanks for your response. |
Answered by
samsonasik
Jan 14, 2025
Replies: 1 comment 1 reply
|
Hi, You can include rector's preload.php for that in phpunit bootstrap, see for example https://github.com/cakephp/upgrade/blob/0f84083e7fa59315c5a37c8c38632d4670bd1001/tests/bootstrap.php#L14 |
1 reply
Answer selected by
samsonasik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, You can include rector's preload.php for that in phpunit bootstrap, see for example https://github.com/cakephp/upgrade/blob/0f84083e7fa59315c5a37c8c38632d4670bd1001/tests/bootstrap.php#L14