php_unit_size_class.rst 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ============================
  2. Rule ``php_unit_size_class``
  3. ============================
  4. All PHPUnit test cases should have ``@small``, ``@medium`` or ``@large``
  5. annotation to enable run time limits.
  6. Description
  7. -----------
  8. The special groups [small, medium, large] provides a way to identify tests that
  9. are taking long to be executed.
  10. Configuration
  11. -------------
  12. ``group``
  13. ~~~~~~~~~
  14. Define a specific group to be used in case no group is already in use
  15. Allowed values: ``'large'``, ``'medium'``, ``'small'``
  16. Default value: ``'small'``
  17. Examples
  18. --------
  19. Example #1
  20. ~~~~~~~~~~
  21. *Default* configuration.
  22. .. code-block:: diff
  23. --- Original
  24. +++ New
  25. <?php
  26. +/**
  27. + * @small
  28. + */
  29. class MyTest extends TestCase {}
  30. Example #2
  31. ~~~~~~~~~~
  32. With configuration: ``['group' => 'medium']``.
  33. .. code-block:: diff
  34. --- Original
  35. +++ New
  36. <?php
  37. +/**
  38. + * @medium
  39. + */
  40. class MyTest extends TestCase {}