Skip to content

cannot pass PHP options #328

@yurii-stickee-2023

Description

@yurii-stickee-2023

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions