Skip to content

Commit 88a7e56

Browse files
authored
Fix phpunit coverage clover (#239)
- Fix phpunit coverage clover
1 parent c9186f5 commit 88a7e56

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ composer.lock
44
vendor/
55
*.DS_Store
66
index.php
7-
clover.xml
7+
coverage.xml
88
.phpunit.result.cache

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ before_script:
1515
- composer install --prefer-dist --dev --no-interaction
1616

1717
script:
18-
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpunit -v --coverage-clover=coverage.xml; fi'
18+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpunit -v; fi'
1919

2020
after_success:
2121
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash <(curl -s https://codecov.io/bash); fi'

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,11 @@
4141
},
4242
"config": {
4343
"platform-check": false
44+
},
45+
"scripts": {
46+
"test": [
47+
"@putenv XDEBUG_MODE=coverage",
48+
"phpunit -v --color=always"
49+
]
4450
}
4551
}

phpunit.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<?xml version="1.0"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
33
<coverage>
4+
<include>
5+
<directory suffix=".php">src</directory>
6+
</include>
47
<report>
5-
<clover outputFile="clover.xml"/>
8+
<clover outputFile="coverage.xml"/>
69
</report>
710
</coverage>
811
<testsuites>
912
<testsuite name="cos">
10-
<directory>tests</directory>
13+
<directory suffix="Test.php">tests</directory>
1114
</testsuite>
1215
</testsuites>
1316
</phpunit>

0 commit comments

Comments
 (0)