sugared-rim / phpunit
PHPUnit sweetened with ease
7.0.0
2018-03-18 18:33 UTC
Requires
- phpunit/phpunit: ^5.0 || ^6.0 || ^7.0
- schnittstabil/composer-extra: ^2.0
- schnittstabil/get: ^2.0 || ^3.0
Requires (Dev)
- gamez/psr-testlogger: ^1.0 || ^2.0
- schnittstabil/phpunit-starter: ^6.0 || ^7.0
README
PHPUnit sweetened with ease 🍒
SugaredRim\PHPUnit takes an opinionated view of testing with PHPUnit, it is preconfigured to get you up and running as quickly as possible.
Install
$ composer require --dev sugared-rim/phpunit
Usage
Instead of requiring and running phpunit
use sugared-rim-phpunit
- that's it, no phpunit.xml*
needed:
{ ... "require-dev": { "sugared-rim/phpunit": ... }, "scripts": { "test": "sugared-rim-phpunit" } }
Configuration
You may overwrite some options by putting it in your composer.json
.
Some of the default settings:
{ ... "scripts": { "test": "sugared-rim-phpunit" }, "extra": { "sugared-rim/phpunit": { "bootstrap": "vendor/autoload.php", "coverage": { "text": "php://stdout", "clover": "build/logs/clover.xml", "html": "build/coverage-phpunit/" }, "src": "src", "tests": "tests", "colors": true, "sugared": { "listeners": [ ] } } } }
src
The source directory.
tests
The tests directory.
coverage
See Command-Line Options for details.
Example: Add SpeedTrapListener
$ composer require --dev johnkary/phpunit-speedtrap
{ ... "extra": { "sugared-rim/phpunit": { "sugared": { "listeners": [ { "class": "JohnKary\\PHPUnit\\Listener\\SpeedTrapListener", "arguments": [{"slowThreshold": 500, "reportLength": 10}] } ] } } } }
License
MIT © Michael Mayer