pestphp / pest

Pest is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
https://pestphp.com
MIT License
9.62k stars 358 forks source link

Pest installation fails on a fresh Laravel v7.24.0 #159

Closed adamhopkinson closed 4 years ago

adamhopkinson commented 4 years ago

I've been intending to have a go with Pest, but it wouldn't install into my project. To avoid getting into debugging versions, I installed a completely fresh copy of Laravel v7.24.0 and Pest still won't install.

My steps (removing responses) were:

  1. composer create-project --prefer-dist laravel/laravel blog
  2. cd blog
  3. Confirm that "minimum-stability": "dev" and "prefer-stable": true are present in composer.json
  4. composer require phpunit/phpunit:"^9.0" --dev --update-with-dependencies
  5. composer require nunomaduro/collision:"^5.0" --dev --update-with-dependencies
  6. composer require pestphp/pest --dev

And the response is:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install pestphp/pest v0.2.4
    - Conclusion: remove phpunit/phpunit 9.3.2
    - Installation request for pestphp/pest ^0.2.4 -> satisfiable by pestphp/pest[v0.2.4, v0.2.x-dev].
    - Conclusion: don't install phpunit/phpunit 9.3.2
    - pestphp/pest v0.2.x-dev requires phpunit/phpunit ~9.2.0 -> satisfiable by phpunit/phpunit[9.2.0, 9.2.1, 9.2.2, 9.2.3, 9.2.4, 9.2.5, 9.2.6, 9.2.x-dev].
    - Can only install one of: phpunit/phpunit[9.2.0, 9.3.2].
    - Can only install one of: phpunit/phpunit[9.2.1, 9.3.2].
    - Can only install one of: phpunit/phpunit[9.2.2, 9.3.2].
    - Can only install one of: phpunit/phpunit[9.2.3, 9.3.2].
    - Can only install one of: phpunit/phpunit[9.2.4, 9.3.2].
    - Can only install one of: phpunit/phpunit[9.2.5, 9.3.2].
    - Can only install one of: phpunit/phpunit[9.2.6, 9.3.2].
    - Can only install one of: phpunit/phpunit[9.2.x-dev, 9.3.2].
    - Installation request for phpunit/phpunit (locked at 9.3.2, required as ^9.0) -> satisfiable by phpunit/phpunit[9.3.2].

Installation failed, reverting ./composer.json to its original content.

Now I understand that it may be technically possible to resolve this issue by editing version requirements in composer.json, but shouldn't it "just work"?

innocenzi commented 4 years ago

Your version constraint is ^9.0, so the new version of PHPUnit, 9.3, will be installed. That new version seems to break Pest, as you can see in #158.

For now, you can just change PHPUnit's version to 9.2, or use @GrahamCampbell's php8 branch.

scrlkx commented 4 years ago

I just replace it by composer require phpunit/phpunit:"9.2.*" --dev --update-with-dependencies while this is break.

GrahamCampbell commented 4 years ago

The bug is with composer. If you manually add pest then run composer update, there will be no issues.

GrahamCampbell commented 4 years ago

Or maybe you also need --update-with-dependencies.

adamhopkinson commented 4 years ago

Great, thanks all for your explanations 🏅