Skip to content

Commit 059816c

Browse files
authored
Add code coverage by coveralls.io. (#13)
1 parent 44a2c4c commit 059816c

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

.coveralls.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
service_name: travis-ci
2+
coverage_clover: /tmp/coverage-clover.xml
3+
json_path: /tmp/coveralls-upload.json

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ install: composer install --no-interaction --classmap-authoritative
1010

1111
script: vendor/bin/phpunit --configuration phpunit.xml
1212

13+
after_success: vendor/bin/php-coveralls --verbose
14+
1315
notifications:
1416
email: false
1517

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Luhn Algorithm
22

33
[![Build Status](https://travis-ci.org/Ekman/Luhn-Algorithm.svg?branch=master)](https://travis-ci.org/Ekman/Luhn-Algorithm)
4+
[![Coverage Status](https://coveralls.io/repos/github/Ekman/Luhn-Algorithm/badge.svg)](https://coveralls.io/github/Ekman/Luhn-Algorithm)
45

56
This is an implementation of the Luhn Algorithm for PHP and HHVM. The Luhn Algorithm is
67
used to validate things like credit cards and national identification numbers.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
},
3939
"require-dev": {
4040
"phpunit/phpunit": "^6.0",
41-
"friendsofphp/php-cs-fixer": "^2.0"
41+
"friendsofphp/php-cs-fixer": "^2.0",
42+
"php-coveralls/php-coveralls": "^2.0"
4243
}
4344
}

phpunit.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
33
bootstrap="vendor/autoload.php">
4-
54
<testsuites>
65
<testsuite name="Luhn Algorithm tests">
76
<directory>tests/</directory>
87
</testsuite>
98
</testsuites>
9+
<filter>
10+
<whitelist>
11+
<directory suffix=".php">src</directory>
12+
</whitelist>
13+
</filter>
14+
<logging>
15+
<log type="coverage-clover" target="/tmp/coverage-clover.xml"/>
16+
</logging>
1017
</phpunit>

0 commit comments

Comments
 (0)