A command line tool for PHPUnit unit testing with live reload.
MIT License
A command line tool for PHPUnit
.
Usage: watch-phpunit [options]
Options:
-h, --help Show help.
-v, --version Show version number.
-c --config Create or override the configuration file.
watch-phpunit
will prompt you to pick a suite from the search result list:
watch-phpunit
Use keybord arrows to highlight your choice, then press <return>
After the tests execution, you can :
add|remove
a default suite
The test suite will restart automatically when watched files are saved.
npm i -D watch-phpunit
npm i -g watch-phpunit
watch-phpunit.config.json
example{
"suites": [
{
"pattern": "**/*.xml",
"dirs": [
"specs/config"
]
}
],
"watch": [
{
"pattern": "**/*.php",
"dirs": [
"."
]
},
{
"pattern": "**/*.xml",
"dirs": [
"specs/config"
]
}
],
"cmd": "docker exec my-container phpunit",
"pathMapping": {
"source": "www",
"target": "/var/www/html"
}
}
├── docker-compose.yml
├── package.json
├── README.md
├── watch-phpunit.config.json
├── www
│ ├── specs
│ │ └── config
│ │ ├── autoload-back.php
│ │ ├── autoload-front.php
│ │ ├── back.xml
│ │ └── front.xml
...
package.json
:
{
"scripts": {
"wpu":"watch-phpunit",
"wpu:config":"watch-phpunit -c"
}
}
npm run wpu
npm run wpu:config