How do I dump variables to the screen when running PHPUnit tests?
Recent versions of PHPUnit swallow output.  To get around this, you need to run with the --debug flag, eg

$ ../vendor/bin/phpunit --debug modules/migrate/tests/src/Unit/process/FormatDateTest.php


Then you can see printed output.

Also note that PHPUnit will skip tests with output in them with the default phpunit.xml file, because it will deem them risky.   To avoid this update the beStrictAboutOutputDuringTests="false" setting and your tests will run.

You can also use the $message parameter to output something when an assertion fails.