Skip to content

🖨 Immediately prints exceptions and assertion failures during testing, with diagnostics.

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

ScriptFUSION/Pip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPUnit Immediate Exception Printer

Latest version Total downloads Build status Test coverage Code style

Immediate Exception Printer is a PHPUnit plug-in that prints out exceptions and assertion failures immediately during a test run. Normally PHPUnit keeps error details secret until the end of the test run, but sometimes we don't want to wait that long. With Immediate Exception Printer, all secrets are immediately revealed, with a few extra benefits, too.

Benefits

  • Immediately print out exceptions and assertion failures as they occur.
  • Display the execution time of each test in tiered colour bands.
  • Display the name of each test case as it is executed.

Usage

  1. Add the library to your Composer file's require-dev section.

    "scriptfusion/phpunit-immediate-exception-printer": "^1"
  2. Declare the printer class in your phpunit.xml configuration file.

    <phpunit printerClass="ScriptFUSION\PHPUnitImmediateExceptionPrinter\ImmediateExceptionPrinter" colors="true" >
  3. Run the tests! If you didn't update phpunit.xml the same options can be specified on the command-line instead.

    vendor/bin/phpunit --printer 'ScriptFUSION\PHPUnitImmediateExceptionPrinter\ImmediateExceptionPrinter' --color
  4. Enjoy immediate test execution feedback.

Preview

The following preview is somewhat atypical but shows all tested output cases this printer supports.

Preview image

Not shown: the normal test summary output you're used to seeing at the end of a test run. This library makes no attempt to modify the summary; only runtime output is changed.

Requirements

  • PHP 5.6 or newer
  • PHPUnit 5.5 or newer

Inspiration

Thanks to the following open source projects that inspired this project. Keep being awesome 👍.

About

🖨 Immediately prints exceptions and assertion failures during testing, with diagnostics.

Topics

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages