PHPUnit fails silently – figuring out the problem

Quick post about PHPUnit – if you’re making changes on your existing tests and all of a sudden PHPUnit starts failing silently, the first thing to do is check the error code:

$ phpunit
$ echo $?

The error code ‘255’ indicates a parse problem, and it’s probably not displaying because you have ‘display_errors = false’ in your php.ini, but this is easily fixable! Just add the following code to your ‘phpunit.xml’ file:

<ini name=”display_errors” value=”true”/>

And you should see what’s causing the problem.