Context
I'm using Composer scripts defined in my composer.json
file to run unit tests in my application.
My composer.json
:
{
"name": "my company/my_application",
"description": "Description of my application",
"license": "my licence",
"require": {
"php": ">=5.6",
"ext-soap": "*",
"ext-ssh2": "*",
"ext-curl": "*",
"ext-zip": "*",
"ext-pdo_mysql": "*",
"ext-gettext": "*",
"dusank/knapsack": "^9.0"
},
"require-dev": {
"ext-mysqli": "*",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "2.*"
},
"scripts": {
"test-php": "vendor/bin/phpunit --colors --verbose --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml",
}
}
My command is:
vendor/bin/phpunit --colors --verbose --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml tests/
Problem
If I run vendor/bin/phpunit --colors --verbose --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml tests/
inside a terminal, I can see colored output. But if I run it using Composer, I don't see any color.
Question
Using Composer scripts defined in composer.json, how to display phpunit colors?