Skip to content

Commit 99b30f7

Browse files
committed
Use a Makefile instead of script to run tests
Ensuring that CI also uses the same commands.
1 parent 86bce23 commit 99b30f7

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ install: travis_retry composer update --prefer-dist
2020

2121
script:
2222
- vendor/bin/phpcs
23-
- vendor/bin/phpcs $(find tests/input/* | sort) --report=summary --report-file=phpcs.log; diff tests/expected_report.txt phpcs.log
23+
- make test-report
2424

2525
stages:
2626
- Validate against schema
@@ -41,6 +41,4 @@ jobs:
4141
- xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd lib/Doctrine/ruleset.xml
4242

4343
- stage: Apply fixes
44-
before_script:
45-
- cp -R tests/input/ tests/input2/
46-
script: vendor/bin/phpcbf tests/input2; [ $? -ne 2 ] && diff tests/input2 tests/fixed
44+
script: make test-fix

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.PHONY: test test-report test-fix
2+
3+
test: test-report test-fix
4+
5+
test-report: vendor
6+
@vendor/bin/phpcs `find tests/input/* | sort` --report=summary --report-file=phpcs.log; diff tests/expected_report.txt phpcs.log
7+
8+
9+
test-fix: vendor
10+
@cp -R tests/input/ tests/input2/
11+
@vendor/bin/phpcbf tests/input2; diff tests/input2 tests/fixed; if [ $$? -ne 0 ]; then rm -rf tests/input2/; exit 1; fi
12+
@rm -rf tests/input2/
13+
14+
vendor: composer.json
15+
composer update

bin/test.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)