MediaWiki  REL1_19
SeleniumTestHTMLLogger.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class SeleniumTestHTMLLogger {
00004         public function setHeaders() {
00005                 global $wgOut;
00006                 $wgOut->addHeadItem( 'selenium', '<style type="text/css">
00007                 .selenium pre {
00008                         overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
00009                         white-space: pre-wrap; /* css-3 */
00010                         white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
00011                         white-space: -pre-wrap; /* Opera 4-6 */
00012                         white-space: -o-pre-wrap; /* Opera 7 */
00013                         /* width: 99%; */
00014                         word-wrap: break-word; /* Internet Explorer 5.5+ */
00015                 }
00016                 .selenium-success { color: green }
00017                 </style>' );
00018         }
00019 
00020         public function write( $message, $mode = false ) {
00021                 global $wgOut;
00022                 $out = '';
00023                 if ( $mode == SeleniumTestSuite::RESULT_OK ) {
00024                         $out .= '<span class="selenium-success">';
00025                 }
00026                 $out .= htmlspecialchars( $message );
00027                 if ( $mode == SeleniumTestSuite::RESULT_OK ) {
00028                         $out .= '</span>';
00029                 }
00030                 if ( $mode != SeleniumTestSuite::CONTINUE_LINE ) {
00031                         $out .= '<br />';
00032                 }
00033 
00034                 $wgOut->addHTML( $out );
00035         }
00036 }