-
-
Notifications
You must be signed in to change notification settings - Fork 175
Description
Currently, there is no way to pass PHP options to underlying commands.
As an example, t is not possible to get correct test coverage with PCOV for custom directories (any other directory except default app/*).
Setup
My setup is current default Laravel application via installer
Laravel 12.4.1
nunomaduro/collision 8.7.0
PHP 8.3.x
How to reproduce
Run PHPUnit with extra option -dpcov.directory=. to include code from custom directory
php -dpcov.directory=. vendor/bin/phpunit --coverage-html=.phpunit.cache/coverage
it will produce coverage 42.86%, which is expected behavior.
Now, run tests via this package as
php -dpcov.directory=. artisan test --coverage --coverage-html=.phpunit.cache/coverage
OR
php -d pcov.directory=. artisan test --coverage --coverage-html=.phpunit.cache/coverage
it will produce coverage 28.57%, which is wrong.
Coverage for custom directory was excluded.
As I understand this is caused by the fact that options are not passed to underlying command.
- TestCommand > Passing on ini settings to phpunit/paratest #284 - pretty much the problem I have
- Allow passing ini settings to PHP #295 MR it was just closed, but I assume it was fixing this issue at that particular moment, can it be revived and merged?
Please correct me if I am wrong, but I consider this behavior of this wrapper command \NunoMaduro\Collision\Adapters\Laravel\Commands\TestCommand as a bug, because missing such ability as passing command options is a major flaw.
Best regards