Skip to content

Commit e9071b4

Browse files
Merge branch '11.5' into 12.3
2 parents 2661f55 + b595dcc commit e9071b4

File tree

6 files changed

+78
-8
lines changed

6 files changed

+78
-8
lines changed

.phive/phars.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
33
<phar name="phpab" version="^1.29" installed="1.29.3" location="./tools/phpab" copy="true"/>
4-
<phar name="php-cs-fixer" version="^3.80" installed="3.87.0" location="./tools/php-cs-fixer" copy="true"/>
4+
<phar name="php-cs-fixer" version="^3.80" installed="3.87.1" location="./tools/php-cs-fixer" copy="true"/>
55
<phar name="humbug/php-scoper" version="^0.18" installed="0.18.17" location="./tools/php-scoper" copy="true"/>
66
<phar name="composer" version="^2.8" installed="2.8.11" location="./tools/composer" copy="true"/>
77
</phive>

ChangeLog-12.3.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 12.3 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [12.3.8] - 2025-MM-DD
6+
7+
### Fixed
8+
9+
* [#6340](https://github.com/sebastianbergmann/phpunit/issues/6340): Implicitly enabled display of deprecation details is not disabled when it should be
10+
511
## [12.3.7] - 2025-08-28
612

713
### Changed
@@ -91,6 +97,7 @@ All notable changes of the PHPUnit 12.3 release series are documented in this fi
9197
* [#6229](https://github.com/sebastianbergmann/phpunit/issues/6229): `Configuration::excludeTestSuite()`, use `Configuration::excludeTestSuites()` instead
9298
* [#6246](https://github.com/sebastianbergmann/phpunit/issues/6246): Using `#[CoversNothing]` on a test method
9399

100+
[12.3.8]: https://github.com/sebastianbergmann/phpunit/compare/12.3.7...12.3
94101
[12.3.7]: https://github.com/sebastianbergmann/phpunit/compare/12.3.6...12.3.7
95102
[12.3.6]: https://github.com/sebastianbergmann/phpunit/compare/12.3.5...12.3.6
96103
[12.3.5]: https://github.com/sebastianbergmann/phpunit/compare/12.3.4...12.3.5

src/TextUI/Configuration/Merger.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -865,31 +865,31 @@ public function merge(CliConfiguration $cliConfiguration, XmlConfiguration $xmlC
865865
$displayDetailsOnAllIssues = true;
866866
}
867867

868-
if ($failOnDeprecation) {
868+
if ($failOnDeprecation && !$doNotFailOnDeprecation) {
869869
$displayDetailsOnTestsThatTriggerDeprecations = true;
870870
}
871871

872-
if ($failOnPhpunitDeprecation) {
872+
if ($failOnPhpunitDeprecation && !$doNotFailOnPhpunitDeprecation) {
873873
$displayDetailsOnPhpunitDeprecations = true;
874874
}
875875

876-
if ($failOnPhpunitNotice) {
876+
if ($failOnPhpunitNotice && !$doNotFailOnPhpunitNotice) {
877877
$displayDetailsOnPhpunitNotices = true;
878878
}
879879

880-
if ($failOnNotice) {
880+
if ($failOnNotice && !$doNotFailOnNotice) {
881881
$displayDetailsOnTestsThatTriggerNotices = true;
882882
}
883883

884-
if ($failOnWarning) {
884+
if ($failOnWarning && !$doNotFailOnWarning) {
885885
$displayDetailsOnTestsThatTriggerWarnings = true;
886886
}
887887

888-
if ($failOnIncomplete) {
888+
if ($failOnIncomplete && !$doNotFailOnIncomplete) {
889889
$displayDetailsOnIncompleteTests = true;
890890
}
891891

892-
if ($failOnSkipped) {
892+
if ($failOnSkipped && !$doNotFailOnSkipped) {
893893
$displayDetailsOnSkippedTests = true;
894894
}
895895

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="../../phpunit.xsd"
4+
failOnPhpunitDeprecation="true"
5+
failOnPhpunitNotice="true"
6+
failOnDeprecation="true"
7+
failOnNotice="true"
8+
failOnWarning="true"
9+
failOnIncomplete="true"
10+
failOnSkipped="true"
11+
>
12+
</phpunit>

tests/unit/TextUI/Configuration/MergerTest.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use function uniqid;
1313
use PHPUnit\Framework\Attributes\CoversClass;
1414
use PHPUnit\Framework\Attributes\Medium;
15+
use PHPUnit\Framework\Attributes\Ticket;
1516
use PHPUnit\Framework\TestCase;
1617
use PHPUnit\TextUI\CliArguments\Builder;
1718
use PHPUnit\TextUI\Configuration\Merger;
@@ -83,4 +84,54 @@ public function testNoCoverageShouldOnlyAffectXmlConfiguration(): void
8384
$this->assertTrue($mergedConfig->hasCoveragePhp());
8485
$this->assertSame($phpCoverage, $mergedConfig->coveragePhp());
8586
}
87+
88+
#[Ticket('https://github.com/sebastianbergmann/phpunit/issues/6340')]
89+
public function testIssue6340(): void
90+
{
91+
$fromFile = (new Loader)->load(TEST_FILES_PATH . 'configuration-issue-6340.xml');
92+
93+
$this->assertTrue($fromFile->phpunit()->failOnPhpunitDeprecation());
94+
$this->assertTrue($fromFile->phpunit()->failOnPhpunitNotice());
95+
$this->assertTrue($fromFile->phpunit()->failOnDeprecation());
96+
$this->assertTrue($fromFile->phpunit()->failOnNotice());
97+
$this->assertTrue($fromFile->phpunit()->failOnWarning());
98+
$this->assertTrue($fromFile->phpunit()->failOnIncomplete());
99+
$this->assertTrue($fromFile->phpunit()->failOnSkipped());
100+
101+
$fromCli = (new Builder)->fromParameters([
102+
'--do-not-fail-on-phpunit-deprecation',
103+
'--do-not-fail-on-phpunit-notice',
104+
'--do-not-fail-on-deprecation',
105+
'--do-not-fail-on-notice',
106+
'--do-not-fail-on-warning',
107+
'--do-not-fail-on-incomplete',
108+
'--do-not-fail-on-skipped',
109+
]);
110+
111+
$this->assertTrue($fromCli->doNotFailOnPhpunitDeprecation());
112+
$this->assertTrue($fromCli->doNotFailOnPhpunitNotice());
113+
$this->assertTrue($fromCli->doNotFailOnDeprecation());
114+
$this->assertTrue($fromCli->doNotFailOnNotice());
115+
$this->assertTrue($fromCli->doNotFailOnWarning());
116+
$this->assertTrue($fromCli->doNotFailOnIncomplete());
117+
$this->assertTrue($fromCli->doNotFailOnSkipped());
118+
119+
$mergedConfig = (new Merger)->merge($fromCli, $fromFile);
120+
121+
$this->assertTrue($mergedConfig->doNotFailOnPhpunitDeprecation());
122+
$this->assertTrue($mergedConfig->doNotFailOnPhpunitNotice());
123+
$this->assertTrue($mergedConfig->doNotFailOnDeprecation());
124+
$this->assertTrue($mergedConfig->doNotFailOnNotice());
125+
$this->assertTrue($mergedConfig->doNotFailOnWarning());
126+
$this->assertTrue($mergedConfig->doNotFailOnIncomplete());
127+
$this->assertTrue($mergedConfig->doNotFailOnSkipped());
128+
129+
$this->assertFalse($mergedConfig->displayDetailsOnPhpunitDeprecations());
130+
$this->assertFalse($mergedConfig->displayDetailsOnPhpunitNotices());
131+
$this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerDeprecations());
132+
$this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerNotices());
133+
$this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerWarnings());
134+
$this->assertFalse($mergedConfig->displayDetailsOnIncompleteTests());
135+
$this->assertFalse($mergedConfig->displayDetailsOnSkippedTests());
136+
}
86137
}

tools/php-cs-fixer

41 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)