Grouping tests is helpful, for example, to distinguish between tests to run in a production environment from those to run in your development environment. You just need to create two groups and then include or exclude them depending on the current environment.
In this section:
- Attaching a test to a group
- Filtering tests by their authors
- Including and excluding test groups from execution
To attach a test to a group
Tag the test with the @group annotation in the format:
/** @group <group specification> */
To enable filtering a test by its author
Tag the test with the @author annotation in the format:
/** @author <author specification> */
To configure execution of a test group
- In the Run/Debug Configuration: PHPUnit on Server dialog box, open the Test groups tab.
- To enable appointing groups to execute, select the Include/Exclude check box.
In the Group Name list, select the relevant group and do one of the following:
- To have the tests in the selected group executed, select the Include check box.
- To have the tests in the selected group skipped, select the Exclude check box.