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:
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 @@ -159,7 +159,9 @@ Please note that using `Constraint::CHECK_MODE_COERCE_TYPES` will modify your or
159
159
## Running the tests
160
160
161
161
``` bash
162
- composer test
163
- composer testOnly TestClass
164
- composer testOnly TestClass::testMethod
162
+ composer test # run all unit tests
163
+ composer testOnly TestClass # run specific unit test class
164
+ composer testOnly TestClass::testMethod # run specific unit test method
165
+ composer style-check # check code style for errors
166
+ composer style-fix # automatically fix code style errors
165
167
```
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