Remove color opt setting from MediaWikiPHPUnitCommand

Change-Id: I08d3b53f80520452aef3fcf2017747406a38664d
This commit is contained in:
addshore 2014-05-05 12:39:40 +01:00
parent d0d4a9227c
commit fefc843bd7
3 changed files with 18 additions and 13 deletions

View file

@ -40,17 +40,6 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
public static function main( $exit = true ) {
$command = new self;
if ( wfIsWindows() ) {
# Windows does not come anymore with ANSI.SYS loaded by default
# PHPUnit uses the suite.xml parameters to enable/disable colors
# which can be then forced to be enabled with --colors.
# The below code inject a parameter just like if the user called
# phpunit with a --no-color option (which does not exist). It
# overrides the suite.xml setting.
# Probably fix bug 29226
$command->arguments['colors'] = false;
}
# Makes MediaWiki PHPUnit directory includable so the PHPUnit will
# be able to resolve relative files inclusion such as suites/*
# PHPUnit uses stream_resolve_include_path() internally

View file

@ -94,6 +94,19 @@ class PHPUnitMaintClass extends Maintenance {
unset( $_SERVER['argv'][$key + 1] ); // its value
$_SERVER['argv'] = array_values( $_SERVER['argv'] );
}
if ( !wfIsWindows() ) {
# If we are not running on windows then we can enable phpunit colors
# Windows does not come anymore with ANSI.SYS loaded by default
# PHPUnit uses the suite.xml parameters to enable/disable colors
# which can be then forced to be enabled with --colors.
# The below code injects a parameter just like if the user called
# Probably fix bug 29226
$key = array_search( '--colors', $_SERVER['argv'] );
if( $key === false ) {
array_splice( $_SERVER['argv'], 1, 0, '--colors' );
}
}
}
public function getDbType() {

View file

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- colors don't work on Windows! -->
<!--
Colors don't work on Windows!
phpunit.php enables colors for other OSs at runtime
-->
<phpunit bootstrap="./bootstrap.php"
colors="true"
colors="false"
backupGlobals="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"