Skip to content

No ticket. Support PHP Unit 11.#1483

Closed
evs-xsarus wants to merge 1 commit intophpspec:mainfrom
evs-xsarus:feature/support_php_unit_11
Closed

No ticket. Support PHP Unit 11.#1483
evs-xsarus wants to merge 1 commit intophpspec:mainfrom
evs-xsarus:feature/support_php_unit_11

Conversation

@evs-xsarus
Copy link
Copy Markdown

With these changes, phpspec will install next to PHP Unit 11.

@jakzal
Copy link
Copy Markdown
Member

jakzal commented Dec 2, 2024

Still, no build actually installs and runs PHPunit 11.

@evs-xsarus
Copy link
Copy Markdown
Author

@jakzal if you need PHPunit 10, you can require that one first. The requirements will then fall back to previous. Or, require phpunit with flag '--with-dependancies':

evs@evs-precision3590:~/sites/spec2 $ c283 require --dev phpunit/phpunit:^10
Composer could not detect the root package (root/spec2) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
./composer.json has been updated
Composer could not detect the root package (root/spec2) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Running composer update phpunit/phpunit
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 phpunit/phpunit ^10 -> satisfiable by phpunit/phpunit[10.0.0, ..., 10.5.38].
    - phpunit/phpunit[10.0.0, ..., 10.5.26] require sebastian/comparator ^5.0 -> found sebastian/comparator[5.0.0, 5.0.1, 5.0.2, 5.0.3] but the package is fixed to 6.2.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - phpunit/phpunit[10.5.27, ..., 10.5.29] require sebastian/comparator ^5.0.1 -> found sebastian/comparator[5.0.1, 5.0.2, 5.0.3] but the package is fixed to 6.2.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - phpunit/phpunit[10.5.30, ..., 10.5.36] require sebastian/comparator ^5.0.2 -> found sebastian/comparator[5.0.2, 5.0.3] but the package is fixed to 6.2.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - phpunit/phpunit[10.5.37, ..., 10.5.38] require sebastian/comparator ^5.0.3 -> found sebastian/comparator[5.0.3] but the package is fixed to 6.2.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
evs@evs-precision3590:~/sites/spec2 $ c283 require --dev phpunit/phpunit:^10 -w
Composer could not detect the root package (root/spec2) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
./composer.json has been updated
Composer could not detect the root package (root/spec2) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Running composer update phpunit/phpunit --with-dependencies
Loading composer repositories with package information
Updating dependencies                                 
Lock file operations: 22 installs, 4 updates, 0 removals
  - Locking myclabs/deep-copy (1.12.1)
  - Locking nikic/php-parser (v5.3.1)
  - Locking phar-io/manifest (2.0.4)
  - Locking phar-io/version (3.2.1)
  - Locking phpunit/php-code-coverage (10.1.16)
  - Locking phpunit/php-file-iterator (4.1.0)
  - Locking phpunit/php-invoker (4.0.0)
  - Locking phpunit/php-text-template (3.0.1)
  - Locking phpunit/php-timer (6.0.0)
  - Locking phpunit/phpunit (10.5.38)
  - Locking sebastian/cli-parser (2.0.1)
  - Locking sebastian/code-unit (2.0.0)
  - Locking sebastian/code-unit-reverse-lookup (3.0.0)
  - Downgrading sebastian/comparator (6.2.1 => 5.0.3)
  - Locking sebastian/complexity (3.2.0)
  - Downgrading sebastian/diff (6.0.2 => 5.1.1)
  - Locking sebastian/environment (6.1.0)
  - Downgrading sebastian/exporter (6.1.3 => 5.1.2)
  - Locking sebastian/global-state (6.0.2)
  - Locking sebastian/lines-of-code (2.0.2)
  - Locking sebastian/object-enumerator (5.0.0)
  - Locking sebastian/object-reflector (3.0.0)
  - Downgrading sebastian/recursion-context (6.0.2 => 5.0.0)
  - Locking sebastian/type (4.0.0)
  - Locking sebastian/version (4.0.1)
  - Locking theseer/tokenizer (1.2.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 22 installs, 4 updates, 0 removals
  - Downgrading sebastian/recursion-context (6.0.2 => 5.0.0): Extracting archive
  - Downgrading sebastian/exporter (6.1.3 => 5.1.2): Extracting archive
  - Downgrading sebastian/diff (6.0.2 => 5.1.1): Extracting archive
  - Downgrading sebastian/comparator (6.2.1 => 5.0.3): Extracting archive
  - Installing sebastian/version (4.0.1): Extracting archive
  - Installing sebastian/type (4.0.0): Extracting archive
  - Installing sebastian/object-reflector (3.0.0): Extracting archive
  - Installing sebastian/object-enumerator (5.0.0): Extracting archive
  - Installing sebastian/global-state (6.0.2): Extracting archive
  - Installing sebastian/environment (6.1.0): Extracting archive
  - Installing sebastian/code-unit (2.0.0): Extracting archive
  - Installing sebastian/cli-parser (2.0.1): Extracting archive
  - Installing phpunit/php-timer (6.0.0): Extracting archive
  - Installing phpunit/php-text-template (3.0.1): Extracting archive
  - Installing phpunit/php-invoker (4.0.0): Extracting archive
  - Installing phpunit/php-file-iterator (4.1.0): Extracting archive
  - Installing theseer/tokenizer (1.2.3): Extracting archive
  - Installing nikic/php-parser (v5.3.1): Extracting archive
  - Installing sebastian/lines-of-code (2.0.2): Extracting archive
  - Installing sebastian/complexity (3.2.0): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (3.0.0): Extracting archive
  - Installing phpunit/php-code-coverage (10.1.16): Extracting archive
  - Installing phar-io/version (3.2.1): Extracting archive
  - Installing phar-io/manifest (2.0.4): Extracting archive
  - Installing myclabs/deep-copy (1.12.1): Extracting archive
  - Installing phpunit/phpunit (10.5.38): Extracting archive
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
38 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
"phpunit/phpunit": "^9.0 || ^10.0",
"phpunit/phpunit": "^9.0 || ^10.0 || ^11.0",
"vimeo/psalm": "^4.3 || ^5.2",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing Psalm 6.0 will allow PHPUnit 11 installation.

Suggested change
"vimeo/psalm": "^4.3 || ^5.2",
"vimeo/psalm": "^4.3 || ^5.2 || ^6.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done #1484 for this exact purpose.

This was referenced Feb 7, 2025
@Jean85
Copy link
Copy Markdown
Contributor

Jean85 commented Mar 18, 2025

@ajgarlag #1484 got merged, if you rebase you get Psalm 6!

@Jean85
Copy link
Copy Markdown
Contributor

Jean85 commented Apr 28, 2025

FYI, #1485 is a nice alternative to this PR.

@alexander-schranz
Copy link
Copy Markdown
Contributor

looks like PHPUnit 11 and 12 is supported and may this PR can be closed not 100% sure.

https://github.com/phpspec/phpspec/releases/tag/7.6.0

@Jean85
Copy link
Copy Markdown
Contributor

Jean85 commented May 12, 2025

Yes I did it all with the help of @MarcelloDuarte in #1488 and #1489. This can be closed.

@MarcelloDuarte
Copy link
Copy Markdown
Member

Thanks @evs-xsarus!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants