According to the composer.json file of 8.5-rc1, its minimum requirement from PHPUnit 6 is 6.1.0. If I do highest-lowest testing on my module this version is being installed. However, if this version is installed I get an error with
/var/www/html $ ./vendor/bin/phpunit -c core
PHPUnit 6.1.0 by Sebastian Bergmann and contributors.
Class '\PHPUnit\Framework\MockObject\Matcher\InvokedRecorder' not found
Probably the reason for this error is the static class alias mapping in this file: https://github.com/drupal/core/blob/8.5.0-rc1/tests/bootstrap.php#L194 and the fact that this class has never existed in this namespace until >= 5.0.
Proof:
https://github.com/sebastianbergmann/phpunit-mock-objects/blob/4.0.4/src...
https://github.com/sebastianbergmann/phpunit-mock-objects/blob/5.0/src/M...
The lowest version of PHPUnit that requires phpunit/phpunit-mock-objects >= 5.0 is >= 6.5.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | require_phpunit_65-2947888-8.patch | 520 bytes | mxr576 |
Comments
Comment #2
chr.fritschThis solves the issue for me.
We also have to check this with PHP5
Comment #3
alexpottMaybe we should just bump the PHPUnit 6 version. As a dev constraint that'd be my preference.
Comment #4
mile23IIRC the only reason we use the low constraint of PHPUnit 6.1 is because that's where they stopped using each(), which let us start using PHP 7.2.
PHPUnit 6.5.7 is the latest release to support PHP 7.0, which fits our needs. PHPUnit 7 requires PHP 7.1
So +1 on updating the constraint in core/composer.json instead of modifying our class aliases.
Comment #5
mxr576Comment #6
mxr576Comment #7
alexpottThis extra line crept in. Shouldn't be there. I'm +1 on bumping the version.
Comment #8
mxr576Thanks, I did not see that.
Comment #9
borisson_Setting to RTBC based on the feedback by @alexpott in #7. #8 fixes the extra blank line that was there.
Comment #10
alexpottCommitted d4cd26c and pushed to 8.6.x. Thanks!
As a composer change only made to 8.6.x.