Skip to content

Commit

Permalink
Added settings for track code coverage
Browse files Browse the repository at this point in the history
Used composer scripts as easy and no-repeated command configuration.
  • Loading branch information
grogy committed Feb 11, 2022
1 parent 415e8fd commit ea63990
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: ./vendor/bin/parallel-lint --exclude vendor . --exclude git . --checkstyle | cs2pr

- name: 'Run unit tests'
run: ./vendor/bin/phpunit
run: composer phpunit

- name: 'Check var dump on own code'
run: ./var-dump-check src
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,17 @@
"bin": ["var-dump-check"],
"replace": {
"jakub-onderka/php-var-dump-check": "*"
},
"scripts" : {
"phpunit": [
"@php ./vendor/phpunit/phpunit/phpunit --no-coverage"
],
"coverage": [
"@php ./vendor/phpunit/phpunit/phpunit"
]
},
"scripts-descriptions": {
"phpunit": "PHP unit",
"coverage": "PHP unit with code coverage"
}
}
8 changes: 8 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
processIsolation="false"
stopOnFailure="false">

<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage/"/>
<text outputFile="php://stdout" showOnlySummary="true"/>
</report>
</coverage>

<testsuites>
<testsuite name="Default tests">
<directory>tests</directory>
Expand Down

0 comments on commit ea63990

Please sign in to comment.