2 if ( !defined( 'MEDIAWIKI' ) ||
!defined( 'SELENIUMTEST' ) ) {
3 echo "This script cannot be run standalone";
7 class SeleniumTestHTMLLogger
{
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++
) {
15 ob_implicit_flush( 1 );
17 // Output some style information
20 overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
21 white-space: pre-wrap; /* css-3 */
22 white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
23 white-space: -pre-wrap; /* Opera 4-6 */
24 white-space: -o-pre-wrap; /* Opera 7 */
26 word-wrap: break-word; /* Internet Explorer 5.5+ */
31 public function write( $message, $mode = false ) {
33 if ( $mode == MW_TESTLOGGER_RESULT_OK
) {
34 $out .= '<font color="green">';
36 $out .= htmlentities( $message );
37 if ( $mode == MW_TESTLOGGER_RESULT_OK
) {
40 if ( $mode != MW_TESTLOGGER_CONTINUE_LINE
) {