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.
Updated: Comment #N
Problem/Motivation
When running phpunit with test coverage, you get the following two errors:
1) Drupal\menu_link\Tests\MenuTreeTest::testOutputWithSingleLevel
PHP_CodeCoverage_Exception: Trying to @cover not existing method "\Drupal\menu_link\MenuTree::output".
2) Drupal\menu_link\Tests\MenuTreeTest::testOutputWithComplexData
PHP_CodeCoverage_Exception: Trying to @cover not existing method "\Drupal\menu_link\MenuTree::output".
Read http://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.a... for more information about @covers
Proposed resolution
::output should be ::output()
Remaining tasks
User interface changes
API changes
Original report by @Berdir
Comment | File | Size | Author |
---|---|---|---|
#8 | drupal_fix-covers-definition-MenuTreeTest-2229123-8.patch | 844 bytes | saltednut |
Comments
Comment #1
dawehner::
Comment #2
dawehnerups.
Comment #3
dawehnerComment #4
saltednutComment #5
saltednutI don't see any errors running PHPunit from the UI. I also don't see anything about including
()
in the docs at http://phpunit.de/manual/3.7/en/code-coverage-analysis.htmlThat said, here's a patch that does what the issue summary asks for.
Comment #6
saltednutPerhaps this should actually be:
@covers ::renderTree
?Comment #7
Berdir(Written in Budapest, submitted in Zurich, so a bit crossposted with @brantwynn, yes renderTree I think)
The UI/simpletest integration is broken anyway, but to see the errors, you need to run the tests with xdebug enabled and --coverage-html ./reports or something like that.
Agreed, () isn't the problem here, the problem is that the method has been renamed, I think it's renderTree now?
That means you should change @covers to that and also rename the test methods, because refer the same non-existing "output" thing.
Comment #8
saltednutOkay, lets try this.
Comment #9
dawehnerooh, embarrassing moment nr2
Comment #10
webchickCommitted and pushed to 8.x. Thanks!