Using PHPUnit Groups

How to set up test groups in PHPUnit? I find that the documents are a little lacking ... he just says

The <groups> element and its <include> , <exclude> and <group> children can be used to select test groups from a set of tests that should (not) work.

 <groups> <include> <group>name</group> </include> <exclude> <group>name</group> </exclude> </groups> 

But how to add directories / files to these groups?

+6
php unit-testing phpunit
source share
1 answer

Add the @group attribute to your testing methods. A simple example from related documents:

 class MyTest extends PHPUnit_Framework_TestCase { /** * @group specification */ public function testSomething() { } /** * @group regresssion * @group bug2204 */ public function testSomethingElse() { } } 
+5
source share

All Articles