Enable debugging output in PHPUnit

Written by

in

When running PHPunit there are only dots and letters for each test by default:

screenshot of a terminal with the phpunit output

To enable debug output and get some more details about the tests running, simply add the logging section to phpunit.xml.dist:

    <logging>
        <log type="testdox-text" target="php://stdout"/>
    </logging>

This will create a debug output and helps to track the tests:

screenshot of a terminal with the phpunit output

In my case, this helped when my code reached an infinite loop due to an error. This results in a RuntimeException without any outputs or log messages. The process just ended with:

[Symfony\Component\Process\Exception\RuntimeException]  
The process has been signaled with signal "11". 
screenshot of a terminal with the phpunit error

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *