Merge "Don’t write to stderr when testing"

This commit is contained in:
jenkins-bot 2018-01-26 14:12:46 +00:00 committed by Gerrit Code Review
commit 276e1296ac

View file

@ -414,7 +414,10 @@ abstract class Maintenance {
$this->fatalError( $err, intval( $die ) );
}
$this->outputChanneled( false );
if ( PHP_SAPI == 'cli' || PHP_SAPI == 'phpdbg' ) {
if (
( PHP_SAPI == 'cli' || PHP_SAPI == 'phpdbg' ) &&
!defined( 'MW_PHPUNIT_TEST' )
) {
fwrite( STDERR, $err . "\n" );
} else {
print $err;