Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
type the following from the root directory
cd core
phpunit --coverage-html html --verbose --bootstrap tests/bootstrap.php
Please note the error only shows with the --coverage-html option enabled.
As of today there are two error relating to outdated @cover statements. One is in the path module.
1) Drupal\Tests\Core\Entity\EntityUrlTest::testGetSystemPath
PHP_CodeCoverage_Exception: Trying to @cover not existing method "\Drupal\Core\Entity\Entity::getPathByAlias".
2) Drupal\path\Tests\Field\PathFieldDefinitionTest::testGetColumns
PHP_CodeCoverage_Exception: Trying to @cover not existing method "\Drupal\path\Plugin\Field\FieldType\PathItem::getSchema".
Proposed resolution
Update the @covers statement to relate to the correct method under test.
Remaining tasks
none
User interface changes
none
API changes
none
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff-0-3.txt | 718 bytes | martin107 |
#3 | pathCovers-2275145-3.patch | 721 bytes | martin107 |
pathCovers.patch | 721 bytes | martin107 | |
Comments
Comment #1
martin107 CreditAttribution: martin107 commentedComment #2
dawehnerthis should be lowercase
Comment #3
martin107 CreditAttribution: martin107 commentedFixed.
interdiff is almost the same size as the patch. :-)
PS Also the incorrect "Schema" made the error go away ... is @covers case insensitive!
Comment #4
dawehnerHa!
Comment #5
jhodgdonThanks! Committed to 8.x.
Comment #6
tstoecklerOops, thanks. That was on my watch...