File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,11 @@ matrix:
24
24
before_install :
25
25
- if [[ "$WITH_COVERAGE" != "true" && "$TRAVIS_PHP_VERSION" != "hhvm" && "$TRAVIS_PHP_VERSION" != "nightly" && "$TRAVIS_PHP_VERSION" != "7.1" ]]; then phpenv config-rm xdebug.ini; fi
26
26
- composer selfupdate
27
+ - if [[ "$TRAVIS_PHP_VERSION" = "hhvm" || "$TRAVIS_PHP_VERSION" = "nightly" ]]; then sed -i '/^.*friendsofphp\/php-cs-fixer.*$/d' composer.json; fi
27
28
28
29
install :
29
30
- travis_retry composer install --no-interaction --prefer-dist
30
31
31
32
script :
32
33
- 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.
195
195
## Running the tests
196
196
197
197
``` 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
201
203
```
Original file line number Diff line number Diff line change 41
41
"require-dev" : {
42
42
"json-schema/JSON-Schema-Test-Suite" : " 1.2.0" ,
43
43
"phpunit/phpunit" : " ^4.8.22" ,
44
+ "friendsofphp/php-cs-fixer" : " ^2.1" ,
44
45
"phpdocumentor/phpdocumentor" : " ~2"
45
46
},
46
47
"autoload" : {
58
59
"scripts" : {
59
60
"test" : " vendor/bin/phpunit" ,
60
61
"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"
62
65
}
63
66
}
You can’t perform that action at this time.
0 commit comments