dingo-d / wp-pest

A package that will add WordPress integration test suite with Pest
MIT License
119 stars 5 forks source link

Cannot use with Pest v2.x #34

Closed eric-hansen closed 5 months ago

eric-hansen commented 5 months ago

Describe your bug

I have PestPHP v2.x installed from trying to set up a good testing environment manually. I discovered this plugin/package that would automate it all. But when I try to install it there's a conflict of PestPHP versions:

❯ composer require dingo-d/wp-pest --dev                       
./composer.json has been updated
Running composer update dingo-d/wp-pest
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires dingo-d/wp-pest * -> satisfiable by dingo-d/wp-pest[1.0.0, ..., 1.6.1].
    - dingo-d/wp-pest[1.0.0, ..., 1.6.1] require pestphp/pest ^1.2 -> found pestphp/pest[v1.2.0, ..., v1.23.1] but it conflicts with your root composer.json require (^2.34).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require dingo-d/wp-pest:*" to figure out if any version is installable, or "composer require dingo-d/wp-pest:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Given the intention of this package is to help encourage WordPress devs to keep things up to date, I think regressing to an older version of PestPHP for this package is counter-intuitive.

Steps to Reproduce

  1. composer require pestphp/pest --dev --with-all-dependencies
  2. composer require dingo-d/wp-pest --dev

Expected behavior

Plugin to be installed and tests to run

Screenshots, screen recording, code snippet

If you'd rather the community update this let me know and I'll see what I can do.

Environment info

No response

Please confirm that you have searched existing issues in this repo.

Yes

dingo-d commented 5 months ago

Hi!

There is a discussion about this already: https://github.com/dingo-d/wp-pest/discussions/26

At the moment, it's not possible to use pest v2 with this library due to library conflict issues (requirement on PHPUnit 10, which is not yet supported in WordPress core integration tests).

Once the upstream issue will be fixed I'll work on bringing this lib up to date.