Skip to content

Commit bcc1fba

Browse files
committed
travis: tested using Nette Coding Standard
1 parent 8cbb23e commit bcc1fba

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

.travis.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,43 @@ matrix:
1818
include:
1919
- php: 7.0
2020
env: COVERAGE=on
21+
- php: 7.1
22+
env: CODING_STANDARD=on
2123

2224
script:
23-
- src/tester -p $TESTER_PHP_BIN --info
24-
- src/tester -p $TESTER_PHP_BIN tests -s $COVERAGE_ARGS
25-
- src/tester -p $TESTER_PHP_BIN -o none tests/fail.phptx; if [ $? -eq 0 ]; then echo "tests/fail.phptx SHOULD FAIL"; exit 1; else echo "fail checked"; fi;
26-
- php code-checker/src/code-checker.php --no-progress --short-arrays
25+
- >
26+
if [ "$TESTER_PHP_BIN" ]; then
27+
src/tester -p $TESTER_PHP_BIN --info
28+
&& src/tester -p $TESTER_PHP_BIN tests -s $COVERAGE_ARGS
29+
&& src/tester -p $TESTER_PHP_BIN -o none tests/fail.phptx; if [ $? -eq 0 ]; then echo "tests/fail.phptx SHOULD FAIL"; exit 1; else echo "fail checked"; fi;
30+
fi
31+
- >
32+
if [ "$CODING_STANDARD" ]; then
33+
php temp/code-checker/src/code-checker.php --short-arrays
34+
&& php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon;
35+
fi
2736
2837
after_failure:
2938
# Print *.actual content
3039
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
3140

3241
before_script:
33-
- travis_retry composer create-project nette/code-checker code-checker ~2.5 --no-interaction
34-
- if [ "$COVERAGE" == "on" ]; then TESTER_PHP_BIN=phpdbg; COVERAGE_ARGS="--coverage ./coverage.xml --coverage-src ./src"; fi
42+
# Install Code Checkers
43+
- >
44+
if [ "$CODING_STANDARD" ]; then
45+
travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-interaction;
46+
travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction;
47+
fi
48+
49+
- if [ "$COVERAGE" ]; then TESTER_PHP_BIN=phpdbg; COVERAGE_ARGS="--coverage ./coverage.xml --coverage-src ./src"; fi
3550

3651
after_script:
3752
# Report Code Coverage
3853
- >
39-
if [ "$COVERAGE" == "on" ]; then
54+
if [ "$COVERAGE" ]; then
4055
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
41-
&& php coveralls.phar --verbose --config tests/.coveralls.yml
42-
|| true; fi
56+
&& php coveralls.phar --verbose --config tests/.coveralls.yml;
57+
fi
4358
4459
sudo: false
4560

tests/coding-standard.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
includes:
2+
- ../temp/coding-standard/coding-standard-php56.neon
3+
4+
parameters:
5+
skip:
6+
PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff:
7+
- src/Framework/FileMock.php

0 commit comments

Comments
 (0)