r.bilgil
r.bilgil

Reputation: 909

PHPUnit takes very long to display errors and fail

I'm using PHPunit to test my classes. When all assertions are correct, things are fine, but whenever there's a PHP error found in the code, PHPunit says something like "Time taken 0 seconds, 1 error" and then takes an extra 10-15 seconds just to display what the error is and where the failure occured. It seems like it does a full stack trace of where the error occurred, which seems more comprehensive than what PHP does by default. Is this the reason for taking too long? If so, is there any way to speed up this process?

Upvotes: 1

Views: 432

Answers (1)

Farid Movsumov
Farid Movsumov

Reputation: 12725

Maybe running tests with --stop-on-failure parameter can help you to not running other tests after error occurs and see reason of error immediately.

> phpunit --stop-on-failure .

Another option is to run your tests with --tap option to find which test slow down your tests

> phpunit --tap .

Upvotes: 1

Related Questions