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
Comment #2
xjmComment #3
xjmComment #4
alexpottIn 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
Comment #5
xjmWe 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.
Comment #6
markus_petrux commentedHi all!
Can we upgrade this component if we use PHP 7.1 or higher or that would break PHPUnit tests?
Thank you!
Comment #7
b.khouyfixed by updating composer
composer self-updateComment #8
caspervoogt commentedNeither 'composer self-update' nor 'composer update' did anything to change this on my end, FWIW.
Comment #9
ebremer commentedNor me, "Neither 'composer self-update' nor 'composer update' did anything to change this on my end, FWIW."
Comment #10
cilefen commentedI 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.
Comment #11
mile23It'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
Comment #12
cilefen commentedShall we close this as a duplicate?
Comment #15
quietone commentedPer #12, closing this as a duplicate of #2950132: Support PHPUnit 7 optionally in Drupal 8, while keeping support for ^6.5.