php_unit_size_class.rst 950 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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'`` and ``'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. +/**
  28. + * @small
  29. + */
  30. class MyTest extends TestCase {}
  31. Example #2
  32. ~~~~~~~~~~
  33. With configuration: ``['group' => 'medium']``.
  34. .. code-block:: diff
  35. --- Original
  36. +++ New
  37. <?php
  38. +
  39. +/**
  40. + * @medium
  41. + */
  42. class MyTest extends TestCase {}