My test case looks like this:
class FooTest extends PHPUnit_Framework_TestCase {
/** @covers MyClass::bar */
function testBar()
{
$result = MyClass::bar();
$this->assertSomething($result);
}
}
Now, the test itself works perfectly fine but code coverage complains with:
PHP_CodeCoverage_Exception: Trying to @cover not existing method "MyClass::bar *//**".
Any ideas?
Another reason (which was the reason in my case) is not using the complete classname including the namespace.
// Should be like
@covers \Vendor\Module\MyClass::doSomething
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With