php_unit_fqcn_annotation.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. =================================
  2. Rule ``php_unit_fqcn_annotation``
  3. =================================
  4. PHPUnit annotations should be a FQCNs including a root namespace.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. final class MyTest extends \PHPUnit_Framework_TestCase
  14. {
  15. /**
  16. - * @expectedException InvalidArgumentException
  17. - * @covers Project\NameSpace\Something
  18. - * @coversDefaultClass Project\Default
  19. - * @uses Project\Test\Util
  20. + * @expectedException \InvalidArgumentException
  21. + * @covers \Project\NameSpace\Something
  22. + * @coversDefaultClass \Project\Default
  23. + * @uses \Project\Test\Util
  24. */
  25. public function testSomeTest()
  26. {
  27. }
  28. }
  29. Rule sets
  30. ---------
  31. The rule is part of the following rule sets:
  32. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  33. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  34. References
  35. ----------
  36. - Fixer class: `PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitFqcnAnnotationFixer <./../../../src/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixer.php>`_
  37. - Test class: `PhpCsFixer\\Tests\\Fixer\\PhpUnit\\PhpUnitFqcnAnnotationFixerTest <./../../../tests/Fixer/PhpUnit/PhpUnitFqcnAnnotationFixerTest.php>`_
  38. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.