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.

Comments

mxr576 created an issue. See original summary.

chr.fritsch’s picture

Status: Active » Needs review
StatusFileSize
new2.35 KB

This solves the issue for me.

We also have to check this with PHP5

alexpott’s picture

Maybe we should just bump the PHPUnit 6 version. As a dev constraint that'd be my preference.

mile23’s picture

IIRC 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.

mxr576’s picture

StatusFileSize
new693 bytes
mxr576’s picture

Issue tags: +Composer
alexpott’s picture

Status: Needs review » Needs work
+++ b/core/composer.json
@@ -1,3 +1,4 @@
+

This extra line crept in. Shouldn't be there. I'm +1 on bumping the version.

mxr576’s picture

Status: Needs work » Needs review
StatusFileSize
new520 bytes

Thanks, I did not see that.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Setting to RTBC based on the feedback by @alexpott in #7. #8 fixes the extra blank line that was there.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed d4cd26c and pushed to 8.6.x. Thanks!

As a composer change only made to 8.6.x.

  • alexpott committed d4cd26c on 8.6.x
    Issue #2947888 by mxr576, chr.fritsch: Drupal core tests actually...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.