From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- tests/selenium/SeleniumTestListener.php | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 tests/selenium/SeleniumTestListener.php (limited to 'tests/selenium/SeleniumTestListener.php') diff --git a/tests/selenium/SeleniumTestListener.php b/tests/selenium/SeleniumTestListener.php new file mode 100644 index 00000000..9436f672 --- /dev/null +++ b/tests/selenium/SeleniumTestListener.php @@ -0,0 +1,68 @@ +logger = $loggerInstance; + } + + public function addError( PHPUnit_Framework_Test $test, Exception $e, $time ) { + $this->logger->write( 'Error: ' . $e->getMessage() ); + $this->tests_failed++; + } + + public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) + { + $this->logger->write( 'Failed: ' . $e->getMessage() ); + $this->tests_failed++; + } + + public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) + { + $this->logger->write( 'Incomplete.' ); + $this->tests_failed++; + } + + public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) + { + $this->logger->write( 'Skipped.' ); + $this->tests_failed++; + } + + public function startTest( PHPUnit_Framework_Test $test ) { + $this->logger->write( + 'Testing ' . $test->getName() . ' ... ', + SeleniumTestSuite::CONTINUE_LINE + ); + } + + public function endTest( PHPUnit_Framework_Test $test, $time ) { + if ( !$test->hasFailed() ) { + $this->logger->write( 'OK', SeleniumTestSuite::RESULT_OK ); + $this->tests_ok++; + } + } + + public function startTestSuite( PHPUnit_Framework_TestSuite $suite ) { + $this->logger->write( 'Testsuite ' . $suite->getName() . ' started.' ); + $this->tests_ok = 0; + $this->tests_failed = 0; + } + + public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) { + $this->logger->write('Testsuite ' . $suite->getName() . ' ended.' ); + if ( $this->tests_ok > 0 || $this->tests_failed > 0 ) { + $this->logger->write( ' OK: ' . $this->tests_ok . ' Failed: ' . $this->tests_failed ); + } + $this->tests_ok = 0; + $this->tests_failed = 0; + } + + public function statusMessage( $message ) { + $this->logger->write( $message ); + } +} + -- cgit v1.2.2