Skip to content

Commit e4810c6

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

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
@@ -13,6 +13,12 @@
1313
processIsolation="false"
1414
stopOnFailure="false">
1515

16+
<logging>
17+
<log type="coverage-clover" target="build/logs/clover.xml"/>
18+
<log type="coverage-html" target="build/coverage/"/>
19+
<log type="coverage-text" target="php://stdout" showOnlySummary="true"/>
20+
</logging>
21+
1622
<testsuites>
1723
<testsuite name="Default tests">
1824
<directory>tests</directory>

0 commit comments

Comments
 (0)