I'm using PHPUnit Bridge in my Symfony project. I'm currently using PHPUnit 7 and I want to upgrade to PHPUnit 8.
In PHPUnit 8 array subset assertions are deprecated and generate warnings. I want to use dms/phpunit-arraysubset-asserts package to provide them. With regular PHPUnit I'd just composer require
it and call it a day.
Now, the Bridge doesn't have original PHPUnit as its dependency, instead it installs it to a temporary folder, patches it and runs from there. phpunit-arraysubset-asserts has PHPUnit dependency though and generates a warning:
Adding phpunit/phpunit as a dependency is discouraged in favor of Symfony's PHPUnit Bridge.
* Instead:
1. Remove it now: composer remove --dev phpunit/phpunit
2. Use Symfony's bridge: composer require --dev phpunit
I don't want to install phpunit/phpunit
to avoid confusion.
I've tried to ignore it by adding a *
replacement, but just adding the replacement to composer.json
produces a Composer error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- __root__ No version set (parsed as 1.0.0) conflicts with symfony/phpunit-bridge[v5.0.5].
- symfony/phpunit-bridge v5.0.5 conflicts with __root__[No version set (parsed as 1.0.0)].
- Installation request for __root__ No version set (parsed as 1.0.0) -> satisfiable by __root__[No version set (parsed as 1.0.0)].
- Installation request for symfony/phpunit-bridge v5.0.5 -> satisfiable by symfony/phpunit-bridge[v5.0.5].
What's the correct way to add a PHPUnit extension when using PHPUnit Bridge?