Skip to content

Laravel, Collision & PHPUnit: Terminal shows warning "Option --configuration cannot be used more than once" #346

@Tjaitil

Description

@Tjaitil

Hello,

When running PHPUnit tests in a Laravel project with a different PHPUnit configuration,
e.g php artisan test --configuration phpunit.foo.xml the terminal produces a warning.

"WARN  Option --configuration cannot be used more than once".

Was mentioned as a collision issue and fixed via a PR in this repo. The original fix has since been removed in commit. So the --configuration flag is passed by default, see TestCommand.

Interestingly enough the warning doesn't appear when using php artisan test -c phpunit.foo.xml. Even though -c and the --configuration is the same according to phpunit.

Reproducable steps in a new laravel project

  1. Create a new laravel project with phpunit
  2. Copy phpunit.xml to phpunit.foo.xml or whatever *.xml
  3. Run php artisan test --configuration phpunit.foo.xml

I would happy to provide a repoducable repo. Thanks in advance.

Laravel version
v12.53.0
nunomaduro/collision version
v8.9.1
Phpunit version
10.5 / 11 / 12
PHP version
8.3

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