edmamerto
edmamerto

Reputation: 8165

Phpunit getting error messages

Initially my problem was getting an error whenever I add --coverage-html in phpunit run. It's weird because I don't get any errors whithout coverage. The error didn't have any error messages other than the letter E in the dots that looked liked this:

.....EEEEEEE

logs were not telling me on which test the errors where coming from so i read the phpunit doc to find answers and learned that adding --testdox would output a checklist format. So I added --testdox to my run script. This is what tail of the logs look like:

someTestA
 [x] Some test 1
 [ ] Some test 2
 [ ] Some test 3

someTestB

It literally wasn't spitting out any logs after the line someTestB. I am now on quest to get error messages on my why those tests are failing.

This is my run script:

$ phpunit --configuration phpunit-configs/myconfig.xml --testdox --coverage-html test-reports/html

This is what my phpunit config looks like:

<phpunit
    backupGlobals="false"
    backupStaticAttributes="false"
    bootstrap="../tests/bootstrap.php"
    colors="true"
    convertErrorsToExceptions="false"
    convertNoticesToExceptions="false"
    convertWarningsToExceptions="false"
    processIsolation="false"
    stopOnFailure="false"
    syntaxCheck="false"
    verbose="true"
>

This is what my php ini looks like:

<php>
    <server name="REQUEST_METHOD" value="GET" />
    <server name="REMOTE_ADDR" value="127.0.0.1" />
    <server name="SERVER_SOFTWARE" value="PHP CLI" />
    <ini name="memory_limit" value="2048M" />
    <ini name="error_reporting" value="E_ALL" />
    <ini name="display_errors" value="On" />
    <ini name="display_startup_errors" value="On" />
</php>

Upvotes: 1

Views: 1052

Answers (1)

Sebastian Bergmann
Sebastian Bergmann

Reputation: 8356

Your version of PHPUnit is outdated. Recent version print detailed information in case a test is not successfully executed when TestDox output is used.

Upvotes: 1

Related Questions