Stop phpunit tests on error

When writing tests it can happen, that one of the tests failes and all the others fail as result of it. Like for example when something in your EntityManager crashes (it's closed and can't be used in any of the following tests which leads to them failing too). That makes it difficult to find the one error that started everthing.

To make it easier, there is a flag for stopping all tests after one throws an exeption or even one which also stops on first failure.

Stop execution upon first error:

$ phpunit --stop-on-error testfolder

Stop execution upon first error or failure:

$ phpunit --stop-on-failure testfolder
comments powered by Disqus