Problem/Motivation

In #3036210: Add justinrainbow/json-schema as a composer dependency so JSON:API can use it to validate its responses, we noticed that phpunit-mock-objects (or at least our current version of it) is being marked as "abandoned" when composer.lock is rebuilt for an unrelated dependency addition.

This is likely due to us using an old version of PHPUnit which has old dependencies.

Proposed resolution

?

Per @larowlan, this probably won't actually break anything, but will probably result in Composer warnings and such that will concern users and lead to bug reports.

The version of phpunit-mock-objects that we use currently is impressively out of date -- 2.3.8, when the current release is 5.0.10. The latest version requires PHP 7.1 (as do the supported versions of PHPUnit itself), but we need to maintain compatibility with PHP 7.0 until #2917655: [9.4.x only] Drop official PHP 7.3 support in Drupal 9.4 is finalized. We also use PHPUnit 4 for testing PHP 5.5 and 5.6, which will be tested once per day on Drupal 8.7.x and 8.6.x following 8.7.0 as per the plan outlined in #2842431: [policy] Remove PHP 5.5, 5.6 support in Drupal 8.7.

Remaining tasks

TBD

User interface changes

N/A

API changes

TBD

Data model changes

N/A

Release notes snippet

TBD

Comments

xjm created an issue. See original summary.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes
alexpott’s picture

In many ways this is a duplicate of #2950132: Support PHPUnit 7 optionally in Drupal 8, while keeping support for ^6.5 as in order to not use phpunit-mock-objects we need to update to a supported version of PHPUnit. I've opened #3039344: Use Symfony's simple-phpunit for an alternate approach using simple-phpunit

xjm’s picture

Version: 8.8.x-dev » 8.7.x-dev

We do potentially need a solution for this in 8.7, even if the solution is a release note or policy doc or something. We still need those nightly tests on PHP 5.

markus_petrux’s picture

Hi all!

Can we upgrade this component if we use PHP 7.1 or higher or that would break PHPUnit tests?

Thank you!

b.khouy’s picture

fixed by updating composer composer self-update

caspervoogt’s picture

Neither 'composer self-update' nor 'composer update' did anything to change this on my end, FWIW.

ebremer’s picture

Nor me, "Neither 'composer self-update' nor 'composer update' did anything to change this on my end, FWIW."

cilefen’s picture

I do not think there is a way to “fix” this in plain phpunit. The library is marked as abandoned, https://packagist.org/packages/phpunit/phpunit-mock-objects, and phpunit versions that still require it (it is now core) are not supported.

Alex’s idea to use Symfony’s wrapper may help in some way.

mile23’s picture

It's just that we're using an older version of PHPUnit. Efforts to allow upgrading are underway: #2950132: Support PHPUnit 7 optionally in Drupal 8, while keeping support for ^6.5

cilefen’s picture

Shall we close this as a duplicate?

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Version: 8.9.x-dev » 8.8.x-dev
Component: other » phpunit
Status: Active » Closed (duplicate)
Issue tags: +Bug Smash Initiative