Download the PHP package appeltaert/phpunit-assertion-message without Composer
On this page you can find all versions of the php package appeltaert/phpunit-assertion-message. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download appeltaert/phpunit-assertion-message
More information about appeltaert/phpunit-assertion-message
Files in appeltaert/phpunit-assertion-message
Package phpunit-assertion-message
Short Description Enhanced PHPUnit Assertion Messages - Debug assertions without creating a mess.
License MIT
Informations about the package phpunit-assertion-message
PHPUnit Assertion Message
Usage
1) Simply wrap whatever message you normally pass to assertions in a new PAM(string $message, [mixed $context,...])
instance.
2) Run phpunit
with --debug
$context
can be basically be anything, for now there's only explicit support for Symfony Response
and Request
objects, but
as a final resort a var flattening processor will take over to basically make anything readable if no processor can handle your context.
Before
This will turn this occasional mess while debugging.
After
Into this.
How it works
Processors
All context passed is handled by a chain of Processors
. The first one to accept the context wins.
The processors are then printed by a Printer
. The default printer Plain
dumps everything into human-readable blocks.
Symfony Response object
Symfony request profiler
Array
Config
Printer
At the moment there is only one printer, Plain
.
Statically set all options
Overriding the environment
roadmap
v1.1
processors
- more symfony
- move them to separate suggested repos
- make them pluggable
printer
- distinctive dumps based on env, more info --verbose, less without
- detect interactive terminal(for colored output f.e.), also check ansi arguments.
- posix_isatty, XTERM check?