I have installed Drupal 11.0-dev to investigate issues with the phpunit (next major) pipeline in https://gitlab.com/drupalspoons/devel/-/jobs/7146821758. Pipeline from gitlab templates invokes phpunit differently than ddev-drupal-contrib:
In .ddev/commands/phpunit there is the following code:
phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@"
I have noticed that HtmlOutputPrinter is present in Drupal 10.3, but has been moved/removed/modified in 11.x.
However, simply removing --printer="\Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger" part of the command so that only phpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@" remains, allows phpunit to run properly (still, I am not sure if output is formatted/handled as expected):
I have installed Drupal 11.0-dev to investigate issues with the
phpunit (next major)
pipeline in https://gitlab.com/drupalspoons/devel/-/jobs/7146821758. Pipeline from gitlab templates invokes phpunit differently than ddev-drupal-contrib:When I try to run phpunit in my local project using
ddev phpunit
, I get the following error:The PHPUnit 10.5 documentation seems to indicate that there is no
--printer
flag.In .ddev/commands/phpunit there is the following code:
phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@"
I have noticed that HtmlOutputPrinter is present in Drupal 10.3, but has been moved/removed/modified in 11.x.
After some digging I have found Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger that might be helpful.
However, simply removing
--printer="\Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger"
part of the command so that onlyphpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@"
remains, allows phpunit to run properly (still, I am not sure if output is formatted/handled as expected):