Skip to content

Commit b315b18

Browse files
committed
Add test coverage
1 parent 132c10f commit b315b18

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

.scrutinizer.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
checks:
2-
php: true
3-
41
filter:
5-
excluded_paths:
6-
- src/Docker/Tests/*
2+
paths: [src/*]
3+
checks:
4+
php:
5+
code_rating: true
6+
duplication: true
7+
tools:
8+
external_code_coverage: true
9+
php_code_sniffer:
10+
config:
11+
standard: "PSR2"

.travis.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ php:
1515
- 7.0
1616
- hhvm
1717

18+
env:
19+
global:
20+
- TEST_COMMAND="composer test"
21+
1822
matrix:
1923
allow_failures:
2024
- php: hhvm
@@ -24,7 +28,7 @@ matrix:
2428
sudo: required
2529
services:
2630
- docker
27-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
31+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
2832

2933
before_install:
3034
- travis_retry composer self-update
@@ -35,7 +39,11 @@ install:
3539
- docker run -p 5000:5000 -d registry
3640

3741
script:
38-
- bin/phpunit
42+
- $TEST_COMMAND
43+
44+
after_success:
45+
- if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
46+
- if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi
3947

4048
after_script:
4149
- sudo cat /var/log/upstart/docker.log

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
"require-dev": {
2828
"phpunit/phpunit": "~3.7"
2929
},
30-
"config": {
31-
"bin-dir": "bin"
30+
"scripts": {
31+
"test": "vendor/bin/phpunit",
32+
"test-ci": "vendor/bin/phpunit --coverage-clover build/coverage.xml"
3233
},
3334
"minimum-stability": "dev",
3435
"prefer-stable": true

0 commit comments

Comments
 (0)