Skip to content

Commit ea63990

Browse files
committed
Added settings for track code coverage
Used composer scripts as easy and no-repeated command configuration.
1 parent 415e8fd commit ea63990

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
processIsolation="false"
1414
stopOnFailure="false">
1515

16+
<coverage>
17+
<report>
18+
<clover outputFile="build/logs/clover.xml"/>
19+
<html outputDirectory="build/coverage/"/>
20+
<text outputFile="php://stdout" showOnlySummary="true"/>
21+
</report>
22+
</coverage>
23+
1624
<testsuites>
1725
<testsuite name="Default tests">
1826
<directory>tests</directory>

0 commit comments

Comments
 (0)