Problem/Motivation

Drupal core now uses a minimum PHPUnit version of 6.5. We should remove the class aliasing layer which allowed us to have BC for PHPUnit 4.

Proposed resolution

Remove BC PHPUnit class aliasing. Adopt PHPUnit 6.5 as our baseline.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

Mile23 created an issue. See original summary.

mile23’s picture

Title: PHPUnit\Framework\BaseTestListener is deprecated, switch DrupalListener to TestListenerDefaultImplementation » Remove PHPUnit 4.8 class aliasing BC layer
Issue summary: View changes
Status: Active » Needs review
Parent issue: » #3060391: Cleanup usage of PHPUnit 4.8 aliased classes

You know, I thought we already removed a bunch of the PHPUnit aliasing stuff, but I guess we didn't.

It turns out that we still need a follow-up to remove the BC aliasing code from core as a follow-up to #3060391: Cleanup usage of PHPUnit 4.8 aliased classes

So I'll rescope here.

But I definitely want to keep this one detail:

Experimentation in #3039344-30: Use Symfony's simple-phpunit shows us that PHPUnit\Framework\BaseTestListener is deprecated in PHPUnit 6.4.

 * @deprecated Use TestListenerDefaultImplementation trait instead
mile23’s picture

Status: Needs review » Active
wim leers’s picture

Status: Active » Needs review
StatusFileSize
new1.57 KB

Is this what we want here?

(I am not at all familiar with all this, but in reviewing #3060391: Cleanup usage of PHPUnit 4.8 aliased classes prior to commit and it just having gotten committed, I think I understand what this is trying to do :D)

mondrake’s picture

#4 basically, yes :)

It will fail now (hopefully) because we added a test to check that the aliased classes exist, https://git.drupalcode.org/project/drupal/commit/50a6a9e#95ea60225f15fb0...

It's an open discussion whether to do this early of wait for D9.

mondrake’s picture

Status: Needs review » Needs work

:( patch apply failures no longer set automatically issues to NW

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new2.75 KB
new4.08 KB

Rerolled and addressed #5.

Status: Needs review » Needs work

The last submitted patch, 7: 3063182-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

catch’s picture

Status: Needs work » Needs review

Test fail looks unrelated so I'm retesting.

wim leers’s picture

Came back green this time :)

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

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mondrake’s picture

Version: 8.9.x-dev » 9.0.x-dev
Category: Bug report » Task
Status: Needs review » Needs work
Issue tags: +Deprecation Removal, +Drupal 9, +Needs reroll
spokje’s picture

Status: Needs work » Needs review
StatusFileSize
new3.91 KB

Re-rollin', re-rollin', re-rollin'
Though the streams are swollen
Keep them patches re-rollin', rawhide
.
..
...
Erm...right...
Reroll of patch in #7

mondrake’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll

There are now some use statements in bootstrap.php that are no longer used.

spokje’s picture

Status: Needs work » Needs review
StatusFileSize
new4.47 KB
new700 bytes

Right...less lyrics quoting, more Coding Standard awareness...

Addressed #14

mondrake’s picture

There are still a couple places where we can find old school PHPUnit class names:

core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php
core/tests/Drupal/Tests/Core/Test/fixtures/phpunit_error.xml

not sure what to do with those

spokje’s picture

@mondrake

core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php

This looks like a simple copy of the Doctrine Test in https://github.com/doctrine/annotations/commit/01ddf2cfa8aaf08d1f22d5354...

Looks to me like the actual class PHPUnit_Framework_TestCase isn't used, only the annotation for it.

core/tests/Drupal/Tests/Core/Test/fixtures/phpunit_error.xml

This looks like a test-resource for \Drupal\Tests\Core\Test\JUnitConverterTest which simply tests if this XML-file is parsed correctly using JUnitConverter::xmlToRows.

Looks to me like the actual old-skool classes PHPUnit_Framework_Error_Notice and PHPUnit_Framework_ExpectationFailedException are not used in anyway, other than needing a test-failure to parse.

I feel like the first should stay as-is, since we want the Doctrine-clone staying as close as possible.
The second one can, IMHO, opinion be replaced by any other Exception, Not sure if that's worth the effort though.

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

#17 ok.

This issue quotes a masterpiece song brought to fame by a couple of dark-suited guys, and, by the way, removes all the cruft related to PHPUnit 4. RTBC.

Proud Mary by CCR would also be worth quoting, but that definitely merits an issue of its own.

spokje’s picture

@mondrake *grin*

Proud Mary by CCR would also be worth quoting...

The next time a patch from me is a "Hail Mary" attempt, (so basically any patch from me) I'll certainly keep that in mind.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 15: 3063182-15.patch, failed testing. View results

spokje’s picture

Status: Needs work » Reviewed & tested by the community

Back to RTBC after random TestBot failure.

  • catch committed 0cc1a13 on 9.0.x
    Issue #3063182 by Spokje, Wim Leers, mondrake, Mile23: Remove PHPUnit 4....
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0cc1a13 and pushed to 9.0.x. Thanks!

Status: Fixed » Closed (fixed)

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