codedungeon / phpunit-result-printer
PHPUnit Pretty Result Printer
Installs: 8 088 323
Dependents: 451
Suggesters: 2
Security: 0
Stars: 1 200
Watchers: 20
Forks: 71
Open Issues: 13
Requires
- php: ^7.1 | ^8.0
- 2bj/phanybar: ^1.0
- codedungeon/php-cli-colors: ^1.10.2
- hassankhan/config: ^0.11.2|^1.0|^2.0|^3.0
- symfony/yaml: ^2.7|^3.0|^4.0|^5.0
Requires (Dev)
- spatie/phpunit-watcher: ^1.6
- dev-master
- 0.32.0
- 0.31.0
- 0.30.1
- 0.30.0
- 0.29.3
- 0.29.2
- 0.29.1
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.2
- 0.26.1
- 0.26.0
- 0.25.1
- 0.25.0
- 0.24.1
- 0.23.4
- 0.23.3
- 0.23.2
- 0.23.0
- 0.22.0
- 0.21.1
- 0.21.0
- 0.20.3
- 0.20.2
- 0.20.1
- 0.20.0
- 0.19.14
- 0.19.13
- 0.19.12
- 0.19.10
- 0.19.9
- 0.19.8
- v0.19.6
- v0.19.5
- v0.19.4
- 0.19.3
- 0.19.2
- 0.19.1
- 0.19.0
- 0.18.10
- 0.18.9
- 0.18.7
- 0.18.6
- 0.18.5
- 0.18.4
- 0.18.3
- 0.18.0
- 0.17.1
- 0.16.1
- 0.16.0
- 0.15.5
- 0.15.4
- 0.15.3
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.2
- 0.12.1
- 0.12.0
- 0.11.4
- 0.11.3
- 0.11.2
- 0.11.0
- 0.10.1
- 0.10.0
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.1
- 0.6.0
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.0
- 0.3.0
- 0.2.1
- 0.1.2
- 0.1.1
- 0.1.0
- 0.0.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.2
- v0.0.1
- dev-release-029
- dev-php74-phpunit9
- dev-143/phpunit8-undefined-method
- dev-137/cant-disable-colors-in-some-cases
- dev-125/pretty-print-assertions
- dev-bugfix/063-phpunit-71x-support
- dev-feature/055-support-customer-printer-markers
- dev-bugfix/023-remove-php7-type-hints
- dev-admin/018-add-circleci-support
This package is auto-updated.
Last update: 2024-11-25 23:25:24 UTC
README
Version 0.29.2 Extend the default PHPUnit Result Printer with a modern, pretty printer!
📦 PHPUnit Pretty Result Printer -- Packagist
Installation
Installation provided via composer and can be done with the following command, the current version requires PHP 7.1 or greater:
> composer require --dev codedungeon/phpunit-result-printer
Upgrading to >= 0.29.x
If you are upgrading from previous verison and have published phpunit-printer.yml
locally, make sure add the following to the options section
... cd-printer-dont-format-classname: false ...
Execute Initialization Script (Optional)
The following steps are optional, but will provide zero configuration for implementing phpunit-pretty-result-printer
- Adds
printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer"
tophpunit.xml
file - Copies default
phpunit-printer.yml
to project root for easier customization
> php ./vendor/codedungeon/phpunit-result-printer/src/init.php
Manual Configuration
Alternately, if you wish to configure phpunit-pretty-result-printer manually, you will need to update your phpunit.xml
file as follows
<?xml version="1.0" encoding="UTF-8"?> <phpunit printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer"> // .... </phpunit>
Or from Command-Line:
> phpunit --printer=Codedungeon\\PHPUnitPrettyResultPrinter\\Printer
Laravel 5.3 with PHP version 7.0.x
If you are using PHP 7.0.x, you will need to use a compatible version of PHPUnit Result Printer (version 0.8.x)
> composer require --dev codedungeon/phpunit-result-printer:^0.8
AnyBar Integration
If you have AnyBar installed, it will be enabled by default. You can disable using cd-printer-anybar-enabled
option (see below)
https://github.com/tonsky/AnyBar
**Anybar is off by default, thus you will need to set the cd-printer-anybar
option in the phpunit-printer.yml
to true
if you wish to use Anybar.
This has been done to address issues with using CI tools such as travis (please see Issue 122 for details) **
NOTE: AnyBar is only available with PHPUnit 7.1 or greater. If you need support for previous versions, please let us know. We are slowly deprecating versions before 7.1.
Configuration Options
- Create a
phpunit-printer.yml
file in your application root to override default (or anywhere use up the parent tree. It will search recursively up the tree until a configuration file is found. If not found, default configuration will be used). The following options are available (along with their default values):
Options
- If
cd-printer-hide-namespace
set tofalse
andcd-printer-dont-format-classname
tofalse
will attempt to keep everyting formatted - If
cd-printer-dont-format-classname
nothing will be formatted and full classname will be displayed
Markers
You can customize the markers which are used for success
, fail
, error
, skipped
, incomplete
by modifying the phpunit-printer.yml
file.
* Notice space after each marker. This makes the output a little more visually appealing, thus keep that in mind when creating your own custom markers
License
Copyright © 2017-2021 Mike Erickson Released under the MIT license
Credits
phpunit-result-printer written by Mike Erickson
E-Mail: codedungeon@gmail.com
Twitter: @codedungeon
Website: https://github.com/mikeerickson