DrupalStandardsListener documents that it only makes sense to receive TestCase objects as parameters to the listener. Unfortunately as is sometimes the case with phpUnit's internal, what makes sense isn't actually the case.

It actually gets weirder, when you have a @requires that isn't met, phpUnit passes a TestSuite into the listener. It doesn't make sense but we can just check the type and conditionally call our coverage test and move on. We'll miss checking the test that isn't run but I think that is ok.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because it breaks phunit functionality for tests.
Issue priority Normal bug
Unfrozen changes Unfrozen because tests
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

I think we can even do better and just recurse if we get a TestSuite object. Then we'll only skip those tests if we get a class that isn't a subclass of either (if that can happen).
Patch attached.

Also, adding #2415441: Automate finding @covers errors as a related issue to improve findability.

neclimdul’s picture

Yeah, that probably is better. It doesn't 100% solve my problem though because now those tests triggers #2443885: DrupalStandardsListener causes errors when it cannot retrieve test results. Missing abstract keyword.. :)

After that's in I think we can mark this RTBC.

drunken monkey’s picture

Ah, yes, same for me …
But just when I wanted to comment there, it was committed. So if the patch works for you, please mark as RTBC (I don't want to do it for my own patch).

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

And that's committed now so RTBC!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed cdc9a44 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary

  • alexpott committed cdc9a44 on 8.0.x
    Issue #2453627 by neclimdul, drunken monkey: Fix DrupalStandardsListener...

Status: Fixed » Closed (fixed)

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