Skip to content

Commit 57307b0

Browse files
committed
add coverage options
1 parent 9a13ccc commit 57307b0

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@
5252
"cs": "vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes",
5353
"cs:fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
5454
"psalm": "vendor/bin/psalm --no-cache --show-info=true",
55-
"coverage": "php -dpcov.enabled=1 -dpcov.directory=. vendor/bin/phpunit --coverage-html coverage",
56-
"phpunit" : "vendor/bin/phpunit"
55+
"all-tests" : "vendor/bin/phpunit --configuration=phpunit.xml --testsuite=All ./tests/",
56+
"unit-tests" : "vendor/bin/phpunit --configuration=phpunit.xml --testsuite=Unit",
57+
"integration-tests" : "vendor/bin/phpunit --configuration=phpunit.xml --testsuite=Integration",
58+
"phpunit-with-coverage" : "XDEBUG_MODE=coverage php -d memory_limit=-1 vendor/bin/phpunit --configuration=phpunit.xml --testsuite=All --coverage-filter=src tests"
5759
}
5860

5961
}

phpunit.dist.xml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,39 @@
22
<phpunit bootstrap="tests/bootstrap.php"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
failOnDeprecation="true"
6+
failOnNotice="true"
7+
failOnPhpunitDeprecation="true"
8+
failOnIncomplete="true"
9+
failOnEmptyTestSuite="true"
10+
failOnRisky="true"
11+
failOnSkipped="true"
12+
failOnWarning="true"
513
>
6-
<!-- Test Suite Configuration -->
714
<testsuites>
815
<testsuite name="Application Test Suite">
9-
<directory>./tests</directory> <!-- Path to your tests directory -->
16+
<directory>./tests</directory>
17+
</testsuite>
18+
<testsuite name="Unit">
19+
<directory>./tests/Unit</directory>
20+
</testsuite>
21+
<testsuite name="Integration">
22+
<directory>./tests/Integration</directory>
1023
</testsuite>
1124
</testsuites>
1225

13-
<coverage processUncoveredFiles="true">
14-
<include>
15-
<directory suffix=".php">src</directory>
16-
</include>
26+
<coverage includeUncoveredFiles="true" pathCoverage="true">
27+
<report>
28+
<html outputDirectory="coverage/html" lowUpperBound="50" highLowerBound="90"/>
29+
<crap4j outputFile="coverage/crap4j.xml" threshold="50"/>
30+
<clover outputFile="coverage/clover.xml"/>
31+
<php outputFile="coverage/coverage.php"/>
32+
</report>
1733
</coverage>
1834

19-
<!--
20-
&lt;!&ndash; Logging &ndash;&gt;
21-
<logging>
22-
<log type="testdox" target="php://stdout" />
23-
</logging>
24-
-->
25-
35+
<php>
2636
<!-- <env name="NEO4J_ADDRESS" value="<put your address here>"/>-->
2737
<!-- <env name="NEO4J_USERNAME" value="<put your name here>"/>-->
2838
<!-- <env name="NEO4J_PASSWORD" value="<put your password here>"/>-->
29-
<!-- No need to set sensitive information here -->
39+
</php>
3040
</phpunit>

0 commit comments

Comments
 (0)