Skip to content

Commit df914e2

Browse files
authored
chore: refactor phpunit config file (#10102)
1 parent f8deb60 commit df914e2

File tree

8 files changed

+27
-24
lines changed

8 files changed

+27
-24
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ phpmetrics.json export-ignore
2727
phpstan-baseline.php export-ignore
2828
phpstan-bootstrap.php export-ignore
2929
phpstan.neon.dist export-ignore
30-
phpunit.xml.dist export-ignore
30+
phpunit.dist.xml export-ignore
3131
psalm-baseline.xml export-ignore
3232
psalm.xml export-ignore
3333
psalm_autoload.php export-ignore

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ _modules/*
127127
.vscode/
128128

129129
/results/
130-
/phpunit*.xml
130+
/phpunit.xml
131131

132132
/.php-cs-fixer.php

admin/framework/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@ _modules/*
123123
.vscode/
124124

125125
/results/
126-
/phpunit*.xml
126+
/phpunit.xml
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
bootstrap="system/Test/bootstrap.php"
66
backupGlobals="false"
77
beStrictAboutOutputDuringTests="true"
88
colors="true"
99
columns="max"
1010
failOnRisky="true"
1111
failOnWarning="true"
12-
cacheDirectory="build/.phpunit.cache">
13-
<coverage
14-
includeUncoveredFiles="true"
15-
pathCoverage="false"
16-
ignoreDeprecatedCodeUnits="true"
17-
disableCodeCoverageIgnore="true">
12+
cacheDirectory="build/.phpunit.cache"
13+
>
14+
<coverage pathCoverage="false" ignoreDeprecatedCodeUnits="true">
1815
<report>
1916
<clover outputFile="build/logs/clover.xml"/>
2017
<html outputDirectory="build/logs/html"/>
2118
<php outputFile="build/logs/coverage.serialized"/>
2219
<text outputFile="php://stdout" showUncoveredFiles="false"/>
2320
</report>
2421
</coverage>
22+
2523
<testsuites>
2624
<testsuite name="App">
2725
<directory>./tests</directory>
2826
</testsuite>
2927
</testsuites>
28+
3029
<logging>
3130
<testdoxHtml outputFile="build/logs/testdox.html"/>
3231
<testdoxText outputFile="build/logs/testdox.txt"/>
3332
<junit outputFile="build/logs/logfile.xml"/>
3433
</logging>
34+
3535
<source>
3636
<include>
3737
<directory suffix=".php">./app</directory>
@@ -41,6 +41,7 @@
4141
<file>./app/Config/Routes.php</file>
4242
</exclude>
4343
</source>
44+
4445
<php>
4546
<server name="app.baseURL" value="http://example.com/"/>
4647
<server name="CODEIGNITER_SCREAM_DEPRECATIONS" value="0"/>

admin/starter/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@ _modules/*
123123
.vscode/
124124

125125
/results/
126-
/phpunit*.xml
126+
/phpunit.xml
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
66
backupGlobals="false"
77
beStrictAboutOutputDuringTests="true"
88
colors="true"
99
columns="max"
1010
failOnRisky="true"
1111
failOnWarning="true"
12-
cacheDirectory="build/.phpunit.cache">
13-
<coverage
14-
includeUncoveredFiles="true"
15-
pathCoverage="false"
16-
ignoreDeprecatedCodeUnits="true"
17-
disableCodeCoverageIgnore="true">
12+
cacheDirectory="build/.phpunit.cache"
13+
>
14+
<coverage pathCoverage="false" ignoreDeprecatedCodeUnits="true">
1815
<report>
1916
<clover outputFile="build/logs/clover.xml"/>
2017
<html outputDirectory="build/logs/html"/>
2118
<php outputFile="build/logs/coverage.serialized"/>
2219
<text outputFile="php://stdout" showUncoveredFiles="false"/>
2320
</report>
2421
</coverage>
22+
2523
<testsuites>
2624
<testsuite name="App">
2725
<directory>./tests</directory>
2826
</testsuite>
2927
</testsuites>
28+
3029
<logging>
3130
<testdoxHtml outputFile="build/logs/testdox.html"/>
3231
<testdoxText outputFile="build/logs/testdox.txt"/>
3332
<junit outputFile="build/logs/logfile.xml"/>
3433
</logging>
34+
3535
<source>
3636
<include>
3737
<directory suffix=".php">./app</directory>
@@ -41,6 +41,7 @@
4141
<file>./app/Config/Routes.php</file>
4242
</exclude>
4343
</source>
44+
4445
<php>
4546
<server name="app.baseURL" value="http://example.com/"/>
4647
<server name="CODEIGNITER_SCREAM_DEPRECATIONS" value="0"/>

phpunit.xml.dist renamed to phpunit.dist.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
bootstrap="system/Test/bootstrap.php"
66
backupGlobals="false"
77
beStrictAboutOutputDuringTests="true"
@@ -12,27 +12,27 @@
1212
failOnRisky="true"
1313
failOnWarning="true"
1414
>
15-
<coverage
16-
pathCoverage="false"
17-
ignoreDeprecatedCodeUnits="true"
18-
disableCodeCoverageIgnore="true">
15+
<coverage pathCoverage="false" ignoreDeprecatedCodeUnits="true">
1916
<report>
2017
<clover outputFile="build/logs/clover.xml"/>
2118
<html outputDirectory="build/coverage/html" highLowerBound="80"/>
2219
<text outputFile="build/coverage/coverage.txt"/>
2320
</report>
2421
</coverage>
22+
2523
<extensions>
2624
<bootstrap class="Nexus\PHPUnit\Tachycardia\TachycardiaExtension">
2725
<parameter name="time-limit" value="0.50" />
2826
<parameter name="report-count" value="30" />
2927
</bootstrap>
3028
</extensions>
29+
3130
<testsuites>
3231
<testsuite name="System">
3332
<directory>tests/system</directory>
3433
</testsuite>
3534
</testsuites>
35+
3636
<source>
3737
<include>
3838
<directory suffix=".php">system</directory>
@@ -51,6 +51,7 @@
5151
<file>system/Test/FeatureTestCase.php</file>
5252
</exclude>
5353
</source>
54+
5455
<php>
5556
<server name="app.baseURL" value="http://example.com/"/>
5657
<server name="CODEIGNITER_SCREAM_DEPRECATIONS" value="1"/>

tests/system/Files/FileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testGuessExtension(): void
5454
$file = new File(SYSTEMPATH . 'index.html');
5555
$this->assertSame('html', $file->guessExtension());
5656

57-
$file = new File(ROOTPATH . 'phpunit.xml.dist');
57+
$file = new File(ROOTPATH . 'phpunit.dist.xml');
5858
$this->assertSame('xml', $file->guessExtension());
5959

6060
$tmp = tempnam(SUPPORTPATH, 'foo');

0 commit comments

Comments
 (0)