@coversDefaultClass
The @coversDefaultClass annotation can be used to specify a default namespace or class name. That way long names don't need to be repeated for every @covers annotation. See Example B.1.
Example B.1: Using @coversDefaultClass to shorten annotations
<?php
use PHPUnit\Framework\TestCase;
/**
* @coversDefaultClass \Foo\CoveredClass
*/
class CoversDefaultClassTest extends TestCase
{
/**
* @covers ::publicMethod
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}
?>
Please login to continue.