Skip to content

Commit 4901a6e

Browse files
Merge branch '12.5' into 13.1
* 12.5: Closes #5881
2 parents 1a10791 + 6449a94 commit 4901a6e

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

ChangeLog-13.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All notable changes of the PHPUnit 13.1 release series are documented in this fi
1111

1212
### Fixed
1313

14+
* [#5881](https://github.com/sebastianbergmann/phpunit/issues/5881): `colors="true"` in XML configuration file does not unconditionally enable colored output
1415
* [#6019](https://github.com/sebastianbergmann/phpunit/issues/6019): `--migrate-configuration` does not update schema location when XML content already validates against current schema
1516
* [#6372](https://github.com/sebastianbergmann/phpunit/issues/6372): Assertion failure inside `willReturnCallback()` is silently swallowed when code under test catches exceptions
1617
* [#6464](https://github.com/sebastianbergmann/phpunit/issues/6464): Process isolation template unconditionally calls `set_include_path()`

src/TextUI/Configuration/Xml/Loader.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,10 +1038,8 @@ private function parseColors(DOMDocument $document): string
10381038
$colors = Configuration::COLOR_DEFAULT;
10391039

10401040
if ($document->documentElement->hasAttribute('colors')) {
1041-
/* only allow boolean for compatibility with previous versions
1042-
'always' only allowed from command line */
10431041
if ($this->booleanFromString($document->documentElement->getAttribute('colors'), false)) {
1044-
$colors = Configuration::COLOR_AUTO;
1042+
$colors = Configuration::COLOR_ALWAYS;
10451043
} else {
10461044
$colors = Configuration::COLOR_NEVER;
10471045
}

tests/end-to-end/_files/coverage/coverage-no-tests-when-wrong-xdebug-mode.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ XDEBUG_MODE=debug
1010
--FILE--
1111
<?php declare(strict_types=1);
1212
$_SERVER['argv'][] = '--do-not-cache-result';
13+
$_SERVER['argv'][] = '--colors=never';
1314
$_SERVER['argv'][] = '--coverage-html';
1415
$_SERVER['argv'][] = 'my_coverage_folder';
1516

tests/unit/TextUI/Configuration/Xml/LoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testShouldReadColorsWhenTrueInConfigurationFile(): void
7171
{
7272
$phpunit = $this->configuration('configuration.colors.true.xml')->phpunit();
7373

74-
$this->assertEquals(Configuration::COLOR_AUTO, $phpunit->colors());
74+
$this->assertEquals(Configuration::COLOR_ALWAYS, $phpunit->colors());
7575
}
7676

7777
public function testShouldReadColorsWhenFalseInConfigurationFile(): void

0 commit comments

Comments
 (0)