1
上下文
我正在使用我的composer.json
文件中定義的Composer腳本在我的應用程序中運行單元測試。使用composer.json中定義的Composer腳本,如何顯示phpunit顏色?
我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",
}
}
我的命令是:
vendor/bin/phpunit --colors --verbose --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml tests/
問題
如果我運行vendor/bin/phpunit --colors --verbose --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml tests/
一個終端內,我可以看到彩色輸出。但是如果我使用Composer運行它,我看不到任何顏色。
問題
使用在composer.json,如何顯示PHPUnit的顏色定義作曲家腳本?