• Stars
    star
    1,215
  • Rank 38,438 (Top 0.8 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PHPUnit Pretty Result Printer -- make your PHPUnit tests look pretty!

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" to phpunit.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 to false and cd-printer-dont-format-classname to false 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

Screenshot

More Repositories

1

validatorjs

A data validation library in JavaScript for the browser and Node.js, inspired by Laravel's Validator.
JavaScript
1,764
star
2

laravel-craftsman

Laravel Craftsman CLI for easily crafting Laravel assets for any project (artisan make on steroids)
PHP
229
star
3

php-cli-colors

Liven up you PHP Console Apps with standard colors
PHP
94
star
4

gulp-phpunit

PHPUnit Plugin for Gulp
JavaScript
35
star
5

todo-webpack-plugin

Webpack Plugin to generate TODO report (markdown, json, xml or text format) and optionally to `stdout` (console)
JavaScript
16
star
6

laravel-ajax

A sample Laravel Application which demonstrates how to integrate jQuery AJAX call to lookup data
JavaScript
12
star
7

node-express-es6-starter

Simple Node Express ES6 Twig Starter
HTML
10
star
8

gulp-codeception

gulp-codeception plugin
JavaScript
8
star
9

gulp-phpspec

gulp-phpspec plugin
JavaScript
6
star
10

gulp-behat

Gulp plugin for Behat testing framework
JavaScript
5
star
11

nptemplating-docs

np.Templating Documentation
JavaScript
4
star
12

gulp-phplint

Gulp Plugin for PHPLint
JavaScript
4
star
13

laravel-versions-cli

Laravel Product Versions CLI
JavaScript
3
star
14

semver-extended-webpack-plugin

Semver webpack plugin
JavaScript
3
star
15

laravel-base

Base packages, etc.
PHP
2
star
16

pkg-menu-cli

Displays Menu of Scripts contained in package.json
JavaScript
2
star
17

php-messenger

PHP console messenger
PHP
2
star
18

gulp-messenger

Console Message Logger for Gulp and Browser
JavaScript
2
star
19

laravel-elixir-behat

Behat Extension used with Laravel Elixir
JavaScript
2
star
20

pkg-version-cli

CLI returning package.json version for current directory
JavaScript
1
star
21

putest

Laravel Testing Framework Demo
PHP
1
star
22

the-office-db

Database of all "The Office" characters
PHP
1
star
23

toastr-snippets

SublimeText Snippets - Toastr
1
star
24

vessel-extended

Vessel Extended - Adds additional commands
Shell
1
star
25

table-multi-select

Wrapper to providing multiple row select in standard HTML table
JavaScript
1
star
26

grunt-gulp-demo

Example demonstration both Grunt and Gulp Workflows
JavaScript
1
star
27

messenger

Node messaging and logging module
JavaScript
1
star
28

laravel-postgres

Starter Package for Laravel w/ PostgreSQL
PHP
1
star
29

laravel-phpunit

Basic Framework for Laravel w/ PHPUnit
PHP
1
star
30

mocha-sinon

Example tests using Mocha with Sinon
JavaScript
1
star
31

cd-players-2016

Players 2016
JavaScript
1
star
32

angular-css-modules

Sample Angular w/ CSS Modules
JavaScript
1
star
33

cd-messenger

Console and File Logger with Gulp support (originally gulp-messenger)
HTML
1
star
34

cd-utils

CodeDungeon Module Utilities
JavaScript
1
star
35

node-express-api

Node Express API
JavaScript
1
star
36

gulp-phpunit-slim3-example

Simple Slim3 Test App for use with gulp-phpunit
PHP
1
star
37

vagrant-laravel

Quick Start Vagrant w/ Laravel
PHP
1
star