New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@covers broken with namespaced function #1898

Closed
Krinkle opened this Issue Oct 5, 2015 · 0 comments

Comments

2 participants
@Krinkle

Krinkle commented Oct 5, 2015

It seems @covers is unable to describe a function provided by a namespace.

Example: https://github.com/wikimedia/at-ease

src/Functions.php:

namespace MediaWiki;

function restoreWarnings() {
 ..
}

tests/FunctionsTest.php

class .. {
     /*
     * @covers MediaWiki\restoreWarnings
     */
  public function testWarningSuppression() {
    ..
  }
}
$ phpunit --coverage-html coverage/
PHPUnit 4.8.10 by Sebastian Bergmann and contributors.

Trying to @cover or @use not existing class or interface "\MediaWiki\suppressWarnings".

Previously filed as #1797.

Krinkle added a commit to wikimedia/at-ease that referenced this issue Oct 6, 2015

tests: Remove broken @Covers tags
PHPUni doesn't support namespaced functions in @Covers yet.
See <sebastianbergmann/phpunit#1898>.

It doesn't matter in this case because strict coverage wasn't
enabled in phpunit.xml anyway, so the result is the same.

Change-Id: I001d9526e8b8a4b5b18f3eb66f07e4c603bfe692

connerbw added a commit to pressbooks/pressbooks that referenced this issue Nov 7, 2015

Travis CI used phpunit 4.5 but we need 4.8. For now, turn off coverag…
…e to suppress problem.

Got: Trying to @cover or @use not existing class or interface "\PressBooks\Media\add_mime_types".
Because: Fixed [#1898](sebastianbergmann/phpunit#1898): `@Covers` and `@uses` cannot be used for namespaced functions

Need to email Travis CI and tell them to upgrade phpunit?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment