How to output in CLI during execution of PHP Unit tests?

后端 未结 18 1654
旧时难觅i
旧时难觅i 2020-11-30 18:01

When running a PHPUnit test, I would like to be able to dump output so I can debug one or two things.

I have tried the following (similar to the PHPUnit Manual examp

18条回答
  •  天命终不由人
    2020-11-30 18:10

    Just use the --verbose flag when execute phpunit.

    $ phpunit --verbose -c phpunit.xml 
    

    The advantage of this method is that you don't need to change the test code, you can print strings, var_dump's o anything you wish always and it will be shown in the console only when verbose mode is set.

    I hope this helps.

提交回复
热议问题