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
Tweaked appearance of NOTE style.
master
1 parent
1fd4b9d
commit
0364ad86af18417c3d20353686113905a95827b6
Nigel Stanger
authored
on 27 Jul 2013
Patch
Showing
2 changed files
Unit_testing/Reporter/HTMLReporter.php
Unit_testing/Reporter/TextReporter.php
Ignore Space
Show notes
View
Unit_testing/Reporter/HTMLReporter.php
<?php require_once 'Reporter.php'; class HTMLReporter extends Reporter { public function report( $status, $reportText, $printfArguments ) { if ( $this->getVerbosity() ) { $statusText = '<p class="blackboard"><span'; switch ( $status ) { case Reporter::STATUS_PASS: $statusText .= ' style="color: green;">✔ '; break; case Reporter::STATUS_SKIPPED: $statusText .= ' style="padding-left: 2em;"># '; break; case Reporter::STATUS_INCOMPLETE: $statusText .= ' style="background-color: yellow;">% '; break; case Reporter::STATUS_FAILURE: $statusText .= ' style="color: red;">✘ '; break; case Reporter::STATUS_ERROR: $statusText .= ' style="color: red;">☠ '; break; case Reporter::STATUS_WARNING: $statusText .= ' style="color: orange;">⚠ '; break; case Reporter::STATUS_NOTE: $statusText .= ' style="background-color: lightgrey;">'; break; default: case Reporter::STATUS_TEST: $statusText .= ' style="font-weight: bold;">'; break; default: $statusText .= ' style="background-color: yellow;">? '; break; } if ( $this->getVerbosity() > 1 ) $statusText .= "<strong>" . ucfirst( strtolower( $status ) ) . ':</strong> '; parent::report( $statusText, $reportText . "</span></p>\n", $printfArguments ); } } public function hr() { echo "<hr />\n"; } } ?>
<?php require_once 'Reporter.php'; class HTMLReporter extends Reporter { public function report( $status, $reportText, $printfArguments ) { if ( $this->getVerbosity() ) { $statusText = '<p class="blackboard"><span'; switch ( $status ) { case Reporter::STATUS_PASS: $statusText .= ' style="color: green;">✔ '; break; case Reporter::STATUS_SKIPPED: $statusText .= ' style="padding-left: 2em;"># '; break; case Reporter::STATUS_INCOMPLETE: $statusText .= ' style="background-color: yellow;">% '; break; case Reporter::STATUS_FAILURE: $statusText .= ' style="color: red;">✘ '; break; case Reporter::STATUS_ERROR: $statusText .= ' style="color: red;">☠ '; break; case Reporter::STATUS_WARNING: $statusText .= ' style="color: orange;">⚠ '; break; case Reporter::STATUS_NOTE: $statusText .= ' style="background-color: yellow;">⚠ '; break; default: case Reporter::STATUS_TEST: $statusText .= ' style="font-weight: bold;">'; break; default: $statusText .= ' style="background-color: yellow;">? '; break; } if ( $this->getVerbosity() > 1 ) $statusText .= "<strong>" . ucfirst( strtolower( $status ) ) . ':</strong> '; parent::report( $statusText, $reportText . "</span></p>\n", $printfArguments ); } } public function hr() { echo "<hr />\n"; } } ?>
Ignore Space
Show notes
View
Unit_testing/Reporter/TextReporter.php
<?php require_once 'Reporter.php'; class TextReporter extends Reporter { public function report ( $status, $reportText, $printfArguments ) { if ( $this->getVerbosity() ) { $statusText = ''; switch ( $status ) { case Reporter::STATUS_PASS: $statusText .= '+++ '; break; case Reporter::STATUS_SKIPPED: $statusText .= '### '; break; case Reporter::STATUS_INCOMPLETE: $statusText .= '%%% '; break; case Reporter::STATUS_FAILURE: $statusText .= '--- '; break; case Reporter::STATUS_ERROR: $statusText .= 'XXX '; break; case Reporter::STATUS_WARNING: $statusText .= '!!! '; break; case Reporter::STATUS_NOTE: break; case Reporter::STATUS_TEST: break; default: $statusText .= '??? '; break; } if ( $this->getVerbosity() > 1 ) $statusText .= $status . ': '; parent::report( $statusText, $reportText . "\n", $printfArguments ); } } public function hr() { echo "------------------------------------------------------------\n"; } } ?>
<?php require_once 'Reporter.php'; class TextReporter extends Reporter { public function report ( $status, $reportText, $printfArguments ) { if ( $this->getVerbosity() ) { $statusText = ''; switch ( $status ) { case Reporter::STATUS_PASS: $statusText .= '+++ '; break; case Reporter::STATUS_SKIPPED: $statusText .= '### '; break; case Reporter::STATUS_INCOMPLETE: $statusText .= '%%% '; break; case Reporter::STATUS_FAILURE: $statusText .= '--- '; break; case Reporter::STATUS_ERROR: $statusText .= 'XXX '; break; case Reporter::STATUS_WARNING: $statusText .= '!!! '; break; case Reporter::STATUS_NOTE: $statusText .= '!!! '; break; case Reporter::STATUS_TEST: break; default: $statusText .= '??? '; break; } if ( $this->getVerbosity() > 1 ) $statusText .= $status . ': '; parent::report( $statusText, $reportText . "\n", $printfArguments ); } } public function hr() { echo "------------------------------------------------------------\n"; } } ?>
Show line notes below