How to tell phpunit to stop on error

I am running a large phpunit test suite, and I would like to see which test failed as soon as it failed, instead of waiting for all tests to complete, after which it lists all the failures.

How can I say phpunit for this?

+42
php unit-testing phpunit
May 04 '15 at 18:28
source share
1 answer

Add the stopOnFailure="true" attribute to the stopOnFailure="true" root element.

You can also use it in the CLI: phpunit --stop-on-failure

Information from the manual and some other that may be useful to you:

  • stopOnError - "Stop execution on first error."
  • stopOnFailure - "Stop execution on the first error or error."
  • stopOnIncomplete - "Stop execution at the first test in progress".

Additional Information: PHPunit manual

+59
May 04 '15 at 18:34
source share



All Articles