php_unit_internal_class.rst 976 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ================================
  2. Rule ``php_unit_internal_class``
  3. ================================
  4. All PHPUnit test classes should be marked as internal.
  5. Configuration
  6. -------------
  7. ``types``
  8. ~~~~~~~~~
  9. What types of classes to mark as internal.
  10. Allowed values: a subset of ``['abstract', 'final', 'normal']``
  11. Default value: ``['normal', 'final']``
  12. Examples
  13. --------
  14. Example #1
  15. ~~~~~~~~~~
  16. *Default* configuration.
  17. .. code-block:: diff
  18. --- Original
  19. +++ New
  20. <?php
  21. +
  22. +/**
  23. + * @internal
  24. + */
  25. class MyTest extends TestCase {}
  26. Example #2
  27. ~~~~~~~~~~
  28. With configuration: ``['types' => ['final']]``.
  29. .. code-block:: diff
  30. --- Original
  31. +++ New
  32. <?php
  33. class MyTest extends TestCase {}
  34. +/**
  35. + * @internal
  36. + */
  37. final class FinalTest extends TestCase {}
  38. abstract class AbstractTest extends TestCase {}
  39. Rule sets
  40. ---------
  41. The rule is part of the following rule set:
  42. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_