]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - maintenance/tests/selenium/SeleniumTestHTMLLogger.php
MediaWiki 1.17.4
[autoinstalls/mediawiki.git] / maintenance / tests / selenium / SeleniumTestHTMLLogger.php
1 <?php
2
3 class SeleniumTestHTMLLogger {
4         public function setHeaders() {
5                 global $wgOut;
6                 $wgOut->addHeadItem( 'selenium', '<style type="text/css">
7                 .selenium pre {
8                         overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
9                         white-space: pre-wrap; /* css-3 */
10                         white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
11                         white-space: -pre-wrap; /* Opera 4-6 */
12                         white-space: -o-pre-wrap; /* Opera 7 */
13                         /* width: 99%; */
14                         word-wrap: break-word; /* Internet Explorer 5.5+ */
15                 }
16                 .selenium-success { color: green }
17                 </style>' );
18         }
19
20         public function write( $message, $mode = false ) {
21                 global $wgOut;
22                 $out = '';
23                 if ( $mode == SeleniumTestSuite::RESULT_OK ) {
24                         $out .= '<span class="selenium-success">';
25                 }
26                 $out .= htmlspecialchars( $message );
27                 if ( $mode == SeleniumTestSuite::RESULT_OK ) {
28                         $out .= '</span>';
29                 }
30                 if ( $mode != SeleniumTestSuite::CONTINUE_LINE ) {
31                         $out .= '<br />';
32                 }
33
34                 $wgOut->addHTML( $out );
35         }
36 }