Skip to content

Commit 02f9990

Browse files
committed
ci: 添加 phpunit.xml.dist 配置文件
1 parent 886a17f commit 02f9990

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
run: composer install --prefer-dist --no-progress --no-interaction
4646

4747
- name: Run tests
48-
run: ./vendor/bin/phpunit --no-coverage
48+
run: ./vendor/bin/phpunit -c phpunit.xml.dist --no-coverage

phpunit.xml.dist

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
4+
bootstrap="tests/bootstrap.php"
5+
colors="true"
6+
cacheDirectory=".phpunit.cache"
7+
failOnRisky="true"
8+
failOnWarning="true"
9+
stopOnFailure="false">
10+
11+
<!-- 测试套件配置 -->
12+
<testsuites>
13+
<testsuite name="Unit Tests">
14+
<directory>tests/Unit</directory>
15+
</testsuite>
16+
<testsuite name="Feature Tests">
17+
<directory>tests/Feature</directory>
18+
</testsuite>
19+
<testsuite name="Performance Tests">
20+
<directory>tests/Performance</directory>
21+
</testsuite>
22+
</testsuites>
23+
24+
<!-- 代码覆盖率配置 -->
25+
<source>
26+
<include>
27+
<directory suffix=".php">src</directory>
28+
</include>
29+
<exclude>
30+
<directory>src/Annotations</directory>
31+
<file>src/ConfigProvider.php</file>
32+
</exclude>
33+
</source>
34+
35+
<!-- PHP 配置 -->
36+
<php>
37+
<ini name="display_errors" value="1"/>
38+
<ini name="error_reporting" value="-1"/>
39+
<ini name="memory_limit" value="512M"/>
40+
<env name="APP_ENV" value="testing"/>
41+
</php>
42+
43+
<!-- 日志配置 -->
44+
<logging>
45+
<junit outputFile="build/logs/junit.xml"/>
46+
<testdoxHtml outputFile="build/logs/testdox.html"/>
47+
</logging>
48+
</phpunit>

0 commit comments

Comments
 (0)