Skip to content

Commit

Permalink
feat(phpunit): Enable phpunit to collect coverage reports and save th…
Browse files Browse the repository at this point in the history
…em as HTML

Signed-off-by: provokateurin <kate@provokateurin.de>
  • Loading branch information
provokateurin committed Sep 16, 2024
1 parent 1bf624f commit b0beea9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ vendor
js/
cypress/downloads/
.idea/
tests/coverage/
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"psalm": "psalm --threads=$(nproc) --no-cache",
"psalm:update-baseline": "psalm --threads=$(nproc) --no-cache --update-baseline",
"psalm:fix": "psalm --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml"
"test:unit": "phpunit -c tests/phpunit.xml",
"test:unit:coverage": "XDEBUG_MODE=coverage phpunit -c tests/phpunit.xml"
},
"config": {
"allow-plugins": {
Expand Down
29 changes: 13 additions & 16 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@
verbose="true"
convertDeprecationsToExceptions="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">../</directory>
</include>
<exclude>
<directory suffix=".php">../tests</directory>
</exclude>
<report>
<clover outputFile="./clover.xml"/>
</report>
</coverage>
<testsuite name="Nextcloud - Group folders App Tests">
<directory suffix=".php">.</directory>
<exclude>./stubs/</exclude>
</testsuite>
<logging/>
<coverage>
<include>
<directory suffix=".php">../lib</directory>
</include>
<report>
<html outputDirectory="coverage" lowUpperBound="50" highLowerBound="90"/>
</report>
</coverage>
<testsuite name="Nextcloud - Group folders App Tests">
<directory suffix=".php">.</directory>
<exclude>./stubs/</exclude>
</testsuite>
<logging/>
</phpunit>

0 comments on commit b0beea9

Please sign in to comment.