File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,11 @@ matrix:
2424before_install :
2525 - if [[ "$WITH_COVERAGE" != "true" && "$TRAVIS_PHP_VERSION" != "hhvm" && "$TRAVIS_PHP_VERSION" != "nightly" && "$TRAVIS_PHP_VERSION" != "7.1" ]]; then phpenv config-rm xdebug.ini; fi
2626 - composer selfupdate
27+ - if [[ "$TRAVIS_PHP_VERSION" = "hhvm" || "$TRAVIS_PHP_VERSION" = "nightly" ]]; then sed -i '/^.*friendsofphp\/php-cs-fixer.*$/d' composer.json; fi
2728
2829install :
2930 - travis_retry composer install --no-interaction --prefer-dist
3031
3132script :
3233 - if [[ "$WITH_COVERAGE" == "true" ]]; then ./vendor/bin/phpunit --coverage-text; else composer test; fi
33- - if [[ "$WITH_PHPCSFIXER" == "true" ]]; then composer require friendsofphp/php-cs-fixer:^2.1 && mkdir -p $HOME/.phpcsfixer && vendor/bin/php-cs-fixer fix --cache-file "$HOME/.phpcsfixer/.php_cs.cache" --dry-run --diff --verbose; fi
34+ - if [[ "$WITH_PHPCSFIXER" == "true" ]]; then mkdir -p $HOME/.phpcsfixer && vendor/bin/php-cs-fixer fix --cache-file "$HOME/.phpcsfixer/.php_cs.cache" --dry-run --diff --verbose; fi
Original file line number Diff line number Diff line change @@ -195,7 +195,9 @@ will modify your original data.
195195## Running the tests
196196
197197``` bash
198- composer test
199- composer testOnly TestClass
200- composer testOnly TestClass::testMethod
198+ composer test # run all unit tests
199+ composer testOnly TestClass # run specific unit test class
200+ composer testOnly TestClass::testMethod # run specific unit test method
201+ composer style-check # check code style for errors
202+ composer style-fix # automatically fix code style errors
201203```
Original file line number Diff line number Diff line change 4141 "require-dev" : {
4242 "json-schema/JSON-Schema-Test-Suite" : " 1.2.0" ,
4343 "phpunit/phpunit" : " ^4.8.22" ,
44+ "friendsofphp/php-cs-fixer" : " ^2.1" ,
4445 "phpdocumentor/phpdocumentor" : " ~2"
4546 },
4647 "autoload" : {
5859 "scripts" : {
5960 "test" : " vendor/bin/phpunit" ,
6061 "testOnly" : " vendor/bin/phpunit --colors --filter" ,
61- "coverage" : " vendor/bin/phpunit --coverage-text"
62+ "coverage" : " vendor/bin/phpunit --coverage-text" ,
63+ "style-check" : " vendor/bin/php-cs-fixer fix --dry-run --verbose --diff" ,
64+ "style-fix" : " vendor/bin/php-cs-fixer fix --verbose"
6265 }
6366}
You can’t perform that action at this time.
0 commit comments