Skip to content

Commit 2c00dac

Browse files
committed
Added settings for track code coverage
1 parent 14aa47c commit 2c00dac

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run: ./vendor/bin/parallel-lint --exclude vendor . --exclude git . --checkstyle | cs2pr
4949

5050
- name: 'Run unit tests'
51-
run: ./vendor/bin/phpunit
51+
run: composer phpunit
5252

5353
- name: 'Check var dump on own code'
5454
run: ./var-dump-check src

composer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,17 @@
2424
"bin": ["var-dump-check"],
2525
"replace": {
2626
"jakub-onderka/php-var-dump-check": "*"
27+
},
28+
"scripts" : {
29+
"phpunit": [
30+
"@php ./vendor/phpunit/phpunit/phpunit --no-coverage"
31+
],
32+
"coverage": [
33+
"@php ./vendor/phpunit/phpunit/phpunit"
34+
]
35+
},
36+
"scripts-descriptions": {
37+
"phpunit": "PHP unit",
38+
"coverage": "PHP unit with code coverage"
2739
}
2840
}

phpunit.xml.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@
1515
</testsuite>
1616
</testsuites>
1717

18+
<logging>
19+
<log type="coverage-clover" target="build/logs/clover.xml"/>
20+
<log type="coverage-html" target="build/coverage/"/>
21+
<log type="coverage-text" target="php://stdout" showOnlySummary="true"/>
22+
</logging>
23+
1824
</phpunit>

0 commit comments

Comments
 (0)