| Q |
A |
| PHPUnit version |
7.0.2 |
| PHP version |
7.2.2-3+ubuntu16.04.1+deb.sury.org+1 |
| Installation Method |
Composer |
vagrant@homestead:~/Code/project$ composer require --dev phpunit/phpunit ^7
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sebastian/diff (locked at 2.0.1) -> satisfiable by sebastian/diff[2.0.1].
- phpunit/phpunit 7.0.0 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0].
- phpunit/phpunit 7.0.1 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0].
- phpunit/phpunit 7.0.2 requires sebastian/diff ^3.0 -> satisfiable by sebastian/diff[3.0.0].
- Conclusion: don't install sebastian/diff 3.0.0
- Installation request for phpunit/phpunit ^7 -> satisfiable by phpunit/phpunit[7.0.0, 7.0.1, 7.0.2].
Installation failed, reverting ./composer.json to its original content.
vagrant@homestead:~/Code/project$
Thanks @mvuajua! I got this error when trying to upgrade my phpunit by requiring it again. Solution for me was to uninstall phpunit and reinstall it:
What is the solution for this problem?
If it can help someone:
If you want for example upgrade to phpunit ^9 without remove/require:
composer require --dev --update-with-dependencies phpunit/phpunit:^9No response and nothing to add nethertheless⦠And he closed the thread š
I had the same problem, even though
sebastian/diffwas not locked down anywhere (and only required to be ^2 by phpunit itself according tocomposer why).Only solution for me was to uninstall phpunit (triggering an uninstall of
sebastian/diffas well) and then to reinstall phpunit.I solved by running
sudo apt-get updatesudo apt install php-xmlThis update other related sebastian dependencies as well so this solution works $ composer remove phpunit/phpunit --dev $ composer require phpunit/phpunit --dev
You have
sebastian/difflocked to a version that is not compatible with the version of PHPUnit you are trying to install. This is not a PHPUnit issue.