tflori / phpunit-printer
A printer for phpunit that prints the name of each test
Installs: 3 878
Dependents: 12
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.3 || ^8.0
- phpunit/phpunit: ^9.0
README
This library holds different printers for phpunit.
ok ok - at the moment there is only one: TextPrinter
How to install
Use composer:
$ composer require tflori/phpunit-printer
note that there is no version defined - composer will automatically install the correct version for your php and phpunit version
Using different phpunit versions in CI
You are maybe developing a library. Then you should not commit the composer.lock
and you are probably
executing your unit tests on different php and phpunit versions. You will then need to modify your
composer.json
manually to use any matching version of phpunit and phpunit-printer:
{ "require": { "phpunit/phpunit": "*", "tflori/phpunit-printer": "*" } }
How to use
You can now start using it by passing the printer to the phpunit configuration.
Via commandline:
$ phpunit --printer PhpUnitPrinter\TextPrinter
Via configuration file:
<?xml version="1.0" encoding="UTF-8"?> <phpunit bootstrap="vendor/autoload.php" printerClass="PhpUnitPrinter\TextPrinter"> <!-- ... --> </phpunit>
Available printer
TextPrinter
The text printer is a copy of a script I found long time ago on the net. I don't remember where I found it, and it didn't have annotations.
If someone knows who has written that printer I would appreciate a hint to honor him in the author section.