Skip to content
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
Closed

@covers broken with namespaced function #1898

Krinkle opened this issue Oct 5, 2015 · 0 comments
Labels
type/bug Something is broken

Comments

@Krinkle
Copy link

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.

@sebastianbergmann sebastianbergmann added the type/bug Something is broken label Oct 6, 2015
Krinkle added a commit to wikimedia/at-ease that referenced this issue Oct 6, 2015
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
dac514 added a commit to pressbooks/pressbooks that referenced this issue Nov 7, 2015
…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
Labels
type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants