The terminal only tells me There was 1 Warning:
. But how can I see the full warning message and where it's being triggered from?
--- this is my phpunit.xml file
<?xml version="1.0"?>
<phpunit
colors="true"
verbose="true"
stopOnFailure="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite name="tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
Hope it is worthy to mention another approach how to show "warnings" that came from PHP during PHPUnit testing.
One way is to show all PHP Errors by enabling PHP error reporing using
error_reporting(E_ALL)
setUp()
method in your tests:Hereafter compare verbosity of either solutions:
First example of output with
error_reporting(E_ALL)
:Second way was already mentioned in other answers is using
displayDetailsOnTestsThatTriggerWarnings="true"
attribute inphpunit.xml
config file.Second example of output with
displayDetailsOnTestsThatTriggerWarnings="true"
: