Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do we specify --testdox in phpunit.xml rather than as command line option?

Tags:

php

phpunit

The output you get from phpunit when you specify --testdox is prettier and more informative than the default dots, so I would like to see it that way all the time. But I've not been able to figure out the way to express my wish for testdox output in a phpunit.xml file, unless it's redirected to a file. I want to see it right away on the console.

Any ideas?

like image 778
David Avatar asked Dec 06 '22 10:12

David


1 Answers

Since PHPUnit 8.1 it is now possible.

You need to do this:

composer require --dev phpunit/phpunit:'^8.1'

and then add testdox="true" as an attribute of your <phpunit> tag.

See my implementation: https://github.com/phpexpertsinc/skeleton/commit/0cacc1f4050363a9f15d9e5ba4b788929e7a3a92

like image 166
Theodore R. Smith Avatar answered Feb 17 '23 04:02

Theodore R. Smith