I use a class to execute a testsuite with PhpUnit like :
$suite = new PHPUnit_Framework_TestSuite('PHPUnit Framework');
$suite->addTestSuite('ClassOne');
$suite->addTestSuite('ClassTwo');
return $suite;
To start the unit test :
# phpunit --stop-on-failure TestSuite.php
If “ClassOne” has an error or exception, the test continue with “ClassTwo”.
How I could stop all the testsuites if the first test failed?
Works with PHPUnit 3.5.14
Using the code below the outputs are as expected:
Two fails running it normally:
and one fail running it with
--stop-on-failureAllTests.php
As a side node. If you look at the
documentation of the current versiononly “suites by file system” and “suites by xml config” are explained options. Just to keep that in mind if you can migrate at the point.