vendredi 14 octobre 2016

Phpunit exclude tests from execution based on TestCase

I have a nested structure of test cases like this:

ControllersTestCase -> ControllerTest

ControllersTestCase -> WidgetTestCase -> WidgetTest

OtherTestCase -> OtherTest

When I run tests I want to exclude all tests that extend ControllersTestCase.

I've tried to add @group annotation to the ControllersTestCase like this

/**
 * @group controllers
 */
class ControllerTestCase extends \Zend_Test_PHPUnit_ControllerTestCase

For this case I want all Widget tests to be excluded as well.

When I run phpunit --exclude-group controllers tests are still executed.

I have many tests under ControllerTestCase so it is the last option to visit all of them and add @group to each of them.

So what can I do to exclude all tests that inherit from ControllersTestCase?

Aucun commentaire:

Enregistrer un commentaire