

GitHub - mikeerickson/phpunit-pretty-result-printer: PHPUnit Pretty Result Print...
source link: https://github.com/mikeerickson/phpunit-pretty-result-printer
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

CodeDungeon PHPUnit Pretty Result Printer
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
Property Name | Default | Description |
---|---|---|
cd-printer-hide-class |
false | Hides the display of the test class name |
cd-printer-simple-output |
false | Uses the default PHPUnit markers (but still uses Printer) |
cd-printer-show-config |
true | Show path to used configuration file |
cd-printer-hide-namespace |
true | Hide test class namespaces (will only show print class name) |
cd-printer-anybar |
true | Enable AnyBar (if anybar is not installed, settings will be ignored) |
cd-printer-anybar-port |
1738 | Define AnyBar port number |
cd-printer-dont-format-classname |
false | Show entire classname* |
- 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.
Marker | Value * |
---|---|
cd-pass | "![]() |
cd-fail | "![]() |
cd-error | "⚈ " |
cd-skipped | "→ " |
cd-incomplete | "∅ " |
cd-risky | "⌽ " |
* 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: [email protected]
Twitter: @codedungeon
Website: https://github.com/mikeerickson
Screenshot
Recommend
-
32
README.md Laravel Craftsman Description Laravel Craftsman (written using the awesome Laravel-Zero C...
-
44
Highlights Single header file Requires C++17 MIT License Quick Start
-
71
README.md
-
17
Yapp Yet Another Pretty Printer. Please note that Yapp is currently in beta, as the grammars are still under development. There is also currently a short wait for the package name to become available,...
-
19
VS Code中开启GDB的pretty-printer功能 准备pretty-printer pretty-printer是干什么的 众所周知,C++的STL容器的实现并不直观,直接使用gdb之类的debugger查看内存是需要周转多次才能看到具体的内容的。 在Visual Studio之...
-
13
TUNA技术沙龙及A Pretty Printer Library in Haskell 技术沙龙准备三天前王康提议开学前的周末搞个活动,之后敲定由Cheer Xiao、heroxbd、Aron Xu和我做演讲。得到消息很诧异,因为以上几位都有...
-
6
Writing a Postgres SQL Pretty Printer in Rust: Part 12021-03-14This is the first of a planned series of blog posts about my pg-pretty project. I’ll cover some things...
-
10
New issue Fix HashMap/HashSet LLDB pretty-printer after hashbrown 0.11.0 #83920
-
10
New issue fix pretty print for loop #86358
-
11
Better PHPUnit CLI output
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK