GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
sqlmarker
Browse code
Changed output formatting slightly.
master
1 parent
4304521
commit
5edbc77fc5b06298818158dcab4fd659b260aadc
Nigel Stanger
authored
on 23 Jul 2013
Patch
Showing
2 changed files
Unit_testing/TestListener/HTMLTestListener.php
Unit_testing/TestListener/TextTestListener.php
Ignore Space
Show notes
View
Unit_testing/TestListener/HTMLTestListener.php
<?php require_once 'SimpleTestListener.php'; class HTMLTestListener extends SimpleTestListener { public function printPass() { echo "<p class='blackboard' style='color: green; padding-left: 2em;'>✔ <strong>OK</strong></p>\n"; } public function printFailure( PHPUnit_Framework_AssertionFailedError $e ) { echo "<p class='blackboard' style='color: red; padding-left: 2em;'>✘ <strong>Failed!</strong> " . htmlspecialchars( $e->getMessage() ) . "</p>\n"; } public function printError( PHPUnit_Framework_AssertionFailedError $e ) { echo "<p class='blackboard' style='color: red; padding-left: 2em;'>☠ <strong>Error!</strong> " . htmlspecialchars( $e->getMessage() ) . "</p>\n"; } public function printIncomplete( PHPUnit_Framework_AssertionFailedError $e ) { echo "<p class='blackboard' style='background-color: yellow; padding-left: 2em;'><strong>Incomplete:</strong> " . htmlspecialchars( $e->getMessage() ) . "</p>\n"; } public function printSkip( PHPUnit_Framework_AssertionFailedError $e ) { echo "<p class='blackboard' style='padding-left: 2em;'><strong>Skipped:</strong> " . htmlspecialchars( $e->getMessage() ) . "</p>\n"; } } ?>
<?php require_once 'SimpleTestListener.php'; class HTMLTestListener extends SimpleTestListener { public function printPass() { echo "<p style='color: green; padding-left: 2em;'><strong>✔ OK</strong></p>\n"; } public function printFailure( PHPUnit_Framework_AssertionFailedError $e ) { echo "<p style='color: red; padding-left: 2em;'><strong>✘ Failed!</strong> " . htmlspecialchars( $e->getMessage() ) . "</p>\n"; } public function printError( PHPUnit_Framework_AssertionFailedError $e ) { echo "<p style='color: red; padding-left: 2em;'><strong>☠ Error!</strong> " . htmlspecialchars( $e->getMessage() ) . "</p>\n"; } public function printIncomplete( PHPUnit_Framework_AssertionFailedError $e ) { echo "<p style='background-color: yellow; padding-left: 2em;'><strong>Incomplete:</strong> " . htmlspecialchars( $e->getMessage() ) . "</p>\n"; } public function printSkip( PHPUnit_Framework_AssertionFailedError $e ) { echo "<p style='padding-left: 2em;'><strong>Skipped:</strong> " . htmlspecialchars( $e->getMessage() ) . "</p>\n"; } } ?>
Ignore Space
Show notes
View
Unit_testing/TestListener/TextTestListener.php
<?php require_once 'SimpleTestListener.php'; class TextTestListener extends SimpleTestListener { public function printPass() { echo " + OK\n"; } public function printFailure( PHPUnit_Framework_AssertionFailedError $e ) { echo " - FAILED! " . $e->getMessage() . "\n"; } public function printError( PHPUnit_Framework_AssertionFailedError $e ) { echo " X ERROR! " . $e->getMessage() . "\n"; } public function printIncomplete( PHPUnit_Framework_AssertionFailedError $e ) { echo " % INCOMPLETE: " .$e->getMessage() . "\n"; } public function printSkip( PHPUnit_Framework_AssertionFailedError $e ) { echo " # SKIPPED: " . $e->getMessage() . "\n"; } } ?>
<?php require_once 'SimpleTestListener.php'; class TextTestListener extends SimpleTestListener { public function printPass() { echo " +++ OK\n"; } public function printFailure( PHPUnit_Framework_AssertionFailedError $e ) { echo " --- FAILED! " . $e->getMessage() . "\n"; } public function printError( PHPUnit_Framework_AssertionFailedError $e ) { echo " XXX ERROR! " . $e->getMessage() . "\n"; } public function printIncomplete( PHPUnit_Framework_AssertionFailedError $e ) { echo " %%% INCOMPLETE: " .$e->getMessage() . "\n"; } public function printSkip( PHPUnit_Framework_AssertionFailedError $e ) { echo " ### SKIPPED: " . $e->getMessage() . "\n"; } } ?>
Show line notes below