| 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$
You have sebastian/diff locked to a version that is not compatible with the version of PHPUnit you are trying to install. This is not a PHPUnit issue.
What is the solution for this problem?
As @sebastianbergmann says the issue creator locked sebastian/diff to 2.0.1. Just remove the line with sebastian/diff in the composer.json.
I had the same problem, even though sebastian/diff was not locked down anywhere (and only required to be ^2 by phpunit itself according to composer why).
Only solution for me was to uninstall phpunit (triggering an uninstall of sebastian/diff as well) and then to reinstall phpunit.
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:
$ 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.
No response and nothing to add nethertheless...
And he closed the thread 馃憥
Solution for me was to uninstall phpunit and reinstall it:
This seem to not keep the same PHPUnit version, am I right? So the heart of the issue is that diff is no longer compatible with PHPUnit 6.5?
This update other related sebastian dependencies as well so this solution works
$ composer remove phpunit/phpunit --dev
$ composer require phpunit/phpunit --dev
composer require --dev phpunit/phpunit-selenium
Using version ^7.0 for phpunit/phpunit-selenium
./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 phpunit/phpunit-selenium ^7.0 -> satisfiable by phpunit/phpunit-selenium[7.0.0].
- phpunit/phpunit-selenium 7.0.0 requires phpunit/phpunit >=7.0,<8.0 -> satisfiable by phpunit/phpunit[7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.1.0, 7.1.1, 7.1.2, 7.1.3, 7.1.4, 7.1.5, 7.2.0, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7, 7.3.0, 7.3.1, 7.3.2, 7.3.3, 7.3.4, 7.3.5, 7.4.0, 7.4.1, 7.4.2, 7.4.3, 7.4.4, 7.4.5, 7.5.0, 7.5.1, 7.5.10, 7.5.11, 7.5.12, 7.5.13, 7.5.14, 7.5.15, 7.5.16, 7.5.2, 7.5.3, 7.5.4, 7.5.5, 7.5.6, 7.5.7, 7.5.8, 7.5.9, 7.5.x-dev] but these conflict with your requirements or minimum-stability.
Installation failed, reverting ./composer.json to its original content.
I face these issues while installing selenium
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:^9
I solved by running
sudo apt-get update
sudo apt install php-xml
I solved with:
sudo apt install php7.3-curl
i solved with
first updated my composer to last version
than composer remove phpunit/phpunit --dev
and composer require phpunit/phpunit --dev
Hi,
I am trying to upgrade PHPUnit 4.5.1in my current project running on CodeIgniter 2.1.0 having PHP 7.2.x, to PHPUnit to 4.8.x, so as to install CIUnit that seems to work for CodeIgniter 2.1.0 as given through this github link : https://github.com/kitsunde/CIUnit. However, i am unable to upgrade PHPUnit through composer.
From the documentation : https://phpunit.de/getting-started/phpunit-4.html, it mentions PHPUnit is compatible with PHP v5.3, 5.4 and 5.5.
So does that mean that the requirement to upgrade to PHPUnit 4.8.x won't work, since my current project is running on CodeIgniter 2.1.0 having PHP 7.2.x? Do I need to upgrade my project to CodeIgniter 3.x and then upgrade PHPUnit from 4.5.1 to 8.x?
$ composer remove phpunit/phpunit --dev
Somente em rodar o comando $ composer remove phpunit/phpunit --dev, j谩 funcionou para mim.
i solved by this :
sudo apt update
sudo apt install php-xml
and finally running apache
Thanks @nikzad-avasam
Most helpful comment
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: