summaryrefslogtreecommitdiff
path: root/tests/selenium/SeleniumTestConsoleLogger.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/selenium/SeleniumTestConsoleLogger.php')
-rw-r--r--tests/selenium/SeleniumTestConsoleLogger.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/selenium/SeleniumTestConsoleLogger.php b/tests/selenium/SeleniumTestConsoleLogger.php
new file mode 100644
index 00000000..b6f5496c
--- /dev/null
+++ b/tests/selenium/SeleniumTestConsoleLogger.php
@@ -0,0 +1,25 @@
+<?php
+
+class SeleniumTestConsoleLogger {
+ public function __construct() {
+ // Prepare testsuite for immediate output
+ @ini_set( 'zlib.output_compression', 0 );
+ @ini_set( 'implicit_flush', 1 );
+ for ( $i = 0; $i < ob_get_level(); $i++ ) {
+ ob_end_flush();
+ }
+ ob_implicit_flush( 1 );
+ }
+
+ public function write( $message, $mode = false ) {
+ $out = '';
+ // if ( $mode == SeleniumTestSuite::RESULT_OK ) $out .= '<font color="green">';
+ $out .= htmlentities( $message );
+ // if ( $mode == SeleniumTestSuite::RESULT_OK ) $out .= '</font>';
+ if ( $mode != SeleniumTestSuite::CONTINUE_LINE ) {
+ $out .= "\n";
+ }
+
+ echo $out;
+ }
+}