Giter Club home page Giter Club logo

phpunit-pretty-result-printer's Introduction

CD PHPUnit Pretty Result Printer

Extend the default PHPUnit Result Printer with a modern, pretty printer!

PHPUnit Pretty Result Printer -- Packagist

Installation

Installation is 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

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.xml to project root for easier customization
$ php ./vendor/codedungeon/phpunit-result-printer/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

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| false |Hide test class namespaces (will only show print class name)

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-2018 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.