more follow-up to r65715: coding style tweaks, etc.
[lhc/web/wiklou.git] / maintenance / tests / selenium / SeleniumTestConsoleLogger.php
1 <?php
2 if ( !defined( 'MEDIAWIKI' ) || !defined( 'SELENIUMTEST' ) ) {
3 echo "This script cannot be run standalone";
4 exit( 1 );
5 }
6
7 class SeleniumTestConsoleLogger {
8 public function __construct() {
9 // Prepare testsuite for immediate output
10 @ini_set( 'zlib.output_compression', 0 );
11 @ini_set( 'implicit_flush', 1 );
12 for ( $i = 0; $i < ob_get_level(); $i++ ) {
13 ob_end_flush();
14 }
15 ob_implicit_flush( 1 );
16 }
17
18 public function write( $message, $mode = false ) {
19 $out = '';
20 //if ( $mode == MW_TESTLOGGER_RESULT_OK ) $out .= '<font color="green">';
21 $out .= htmlentities( $message );
22 //if ( $mode == MW_TESTLOGGER_RESULT_OK ) $out .= '</font>';
23 if ( $mode != MW_TESTLOGGER_CONTINUE_LINE ) {
24 $out .= "\n";
25 }
26
27 echo $out;
28 }
29 }