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.
$ composer require --dev sugared-rim/phpunit
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"
}
}
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": [
]
}
}
}
}
The source directory.
The tests directory.
See Command-Line Options for details.
$ composer require --dev johnkary/phpunit-speedtrap
{
...
"extra": {
"sugared-rim/phpunit": {
"sugared": {
"listeners": [
{
"class": "JohnKary\\PHPUnit\\Listener\\SpeedTrapListener",
"arguments": [{"slowThreshold": 500, "reportLength": 10}]
}
]
}
}
}
}
MIT © Michael Mayer