diff --git a/Unit_testing/Reporter.php b/Unit_testing/Reporter.php new file mode 100644 index 0000000..131d85f --- /dev/null +++ b/Unit_testing/Reporter.php @@ -0,0 +1,49 @@ +verbosity = $verbosity; + } + + public static function pluralise( $count, $oneText, $manyText ) + { + return ( $count > 1 ) ? $manyText : $oneText; + } + + public function setVerbosity( $newVerbosity ) + { + $this->verbosity = $newVerbosity; + } + + public function getVerbosity() + { + return $this->verbosity; + } + + /** + * $status is one of: PASSED, FAILED, ERROR, INCOMPLETE, SKIPPED, WARNING, NOTE, ...? + * $text is a printf-style string (although we actually use vprintf because of the array) + * $arguments is an array of arguments to $text + */ + public function report( $statusText, $reportText, $printfArguments ) + { + if ( $this->verbosity ) vprintf( $statusText . $reportText, $printfArguments ); + } +} + +?>