2 if (!defined('MEDIAWIKI') ||
!defined('SELENIUMTEST')) {
3 echo "This script cannot be run standalone";
7 class SeleniumTestHTMLLogger
9 public function __construct()
11 // Prepare testsuite for immediate output
12 @ini_set
('zlib.output_compression', 0);
13 @ini_set
('implicit_flush', 1);
14 for ($i = 0; $i < ob_get_level(); $i++
) { ob_end_flush(); }
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+ */
33 public function write($message, $mode = false)
36 if ($mode == MW_TESTLOGGER_RESULT_OK
) $out .= '<font color="green">';
37 $out .= htmlentities($message);
38 if ($mode == MW_TESTLOGGER_RESULT_OK
) $out .= '</font>';
39 if ($mode != MW_TESTLOGGER_CONTINUE_LINE
) $out .= '<br/>';