Figure out how to check for unintentionally covered code

Created on 1 December 2015, over 9 years ago
Updated 23 January 2023, about 2 years ago

Follow up to #2105583: Add some sane strictness to phpunit tests to catch risky tests

Problem/Motivation

Checking for unintentionally covered code is useful for identifying weakness in coverage reports and making them more useful. However, checkForUnintentionallyCoveredCode's current behavior causes some problems because it doesn't recursively check parent classes for @uses information. This means any code run in our UnitTestCase::setUp() method will always be "unintentionally covered."

Proposed resolution

Obviously we don't want to work around this by adding the @uses to _every_ unit test we implement so we either need to
1) Remove that code from the setUp
2) Allow usage of phpunit's testcase and convert most tests to use it. add @uses to tests that do user Drupal's UnitTestCase.
3) Work upstream to support recursive @uses resolution.

I don't think 1 or 2 are likely so we'll probably need to work with phpunit to get this feature added.

Remaining tasks

📌 Task
Status

Postponed

Version

9.5

Component
PHPUnit 

Last updated about 8 hours ago

Created by

🇺🇸United States neclimdul Houston, TX

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024