Question: I don't want to run all the tests sometimes to save time. I know I can comment the tests. But this method isn't elegant. I'm wondering whether there is some simple way to do that.

All advice is appreciated.

Thanks for your time and best regards,
Box He

Answer: 
**[@group](http://www.phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.group)**

A test can be tagged as belonging to one or more groups using the @group annotation like this

```
class MyTest extends PHPUnit_Framework_TestCase
{
    /**
     * @group specification
     */
    public function testSomething()
    {
    }

    /**
     * @group regresssion
     * @group bug2204
     */
    public function testSomethingElse()
    {
    }
}

```

Tests can be selected for execution based on groups using the --group and --exclude-group switches of the command-line test runner or using the respective directives of the XML configuration file.
`phpunit` [command line test runner](http://www.phpunit.de/manual/current/en/textui.html) has `--filter` argument which is a regular expression to match the executed test case names.

Suppose, you need to exclude all the test cases, names of which contain "Foo". Then, use:

```
--filter /^(?:(?!Foo).)*$/

```