Skip to content

Commit cb925b8

Browse files
authored
Merge pull request #21 from aternosorg/align-tests-workflow
Collect code coverage of the client in unit tests
2 parents c8db1c6 + 068324e commit cb925b8

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎.github/workflows/tests.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
php-version: ${{ matrix.php-version }}
2929
extensions: curl, json, mbstring
30-
coverage: none
30+
coverage: pcov
3131
tools: composer:v2
3232

3333
- name: Set composer cache directory
@@ -46,8 +46,8 @@ jobs:
4646
- name: Install composer dependencies
4747
run: composer install --no-interaction --prefer-dist --no-progress
4848

49-
- name: Run phpunit unit tests
50-
run: vendor/bin/phpunit --testsuite=unit --colors=always --testdox
49+
- name: Run phpunit unit tests with coverage
50+
run: vendor/bin/phpunit --testsuite=unit --colors=always --testdox --coverage-clover=coverage.xml
5151

5252
# integration tests send requests to the live CurseForge API and need the CURSEFORGE_API_KEY secret,
5353
# so they only run on the master branch and when started manually

‎phpunit.xml.dist‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="./vendor/autoload.php"
4+
bootstrap="vendor/autoload.php"
55
colors="true"
66
executionOrder="random"
77
displayDetailsOnTestsThatTriggerDeprecations="true"
88
displayDetailsOnTestsThatTriggerErrors="true"
99
displayDetailsOnTestsThatTriggerNotices="true"
1010
displayDetailsOnTestsThatTriggerWarnings="true">
11-
<source>
12-
<include>
13-
<directory>src</directory>
14-
</include>
15-
</source>
16-
<testsuites>
17-
<testsuite name="integration">
18-
<directory>./tests/Integration/Client</directory>
19-
</testsuite>
20-
<testsuite name="unit">
21-
<directory>tests/Unit/Client</directory>
22-
</testsuite>
23-
</testsuites>
24-
<php>
25-
<ini name="error_reporting" value="E_ALL"/>
26-
</php>
11+
<testsuites>
12+
<testsuite name="unit">
13+
<directory>tests/Unit/Client</directory>
14+
</testsuite>
15+
<testsuite name="integration">
16+
<directory>tests/Integration/Client</directory>
17+
</testsuite>
18+
</testsuites>
19+
<source>
20+
<include>
21+
<directory>src/Client</directory>
22+
</include>
23+
</source>
24+
<php>
25+
<ini name="error_reporting" value="E_ALL"/>
26+
</php>
2727
</phpunit>

0 commit comments

Comments
 (0)