php_unit_test_class_requires_covers.rst 678 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ============================================
  2. Rule ``php_unit_test_class_requires_covers``
  3. ============================================
  4. Adds a default ``@coversNothing`` annotation to PHPUnit test classes that have
  5. no ``@covers*`` annotation.
  6. Examples
  7. --------
  8. Example #1
  9. ~~~~~~~~~~
  10. .. code-block:: diff
  11. --- Original
  12. +++ New
  13. <?php
  14. +
  15. +/**
  16. + * @coversNothing
  17. + */
  18. final class MyTest extends \PHPUnit_Framework_TestCase
  19. {
  20. public function testSomeTest()
  21. {
  22. $this->assertSame(a(), b());
  23. }
  24. }
  25. Rule sets
  26. ---------
  27. The rule is part of the following rule set:
  28. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_