Source for file cli_reporter.php
Documentation is available at cli_reporter.php
* Swiped from the WACT test suite
* @see http://www.phpwact.org
* @version $Id: cli_reporter.php,v 1.1 2007/09/09 20:39:50 pitlinz Exp $
if (! defined('ST_FAILDETAIL_SEPARATOR')) {
define('ST_FAILDETAIL_SEPARATOR', "->");
if (! defined('ST_FAILS_RETURN_CODE')) {
define('ST_FAILS_RETURN_CODE', 1);
define('STDOUT', fopen('php://stdout', 'w'));
define('STDERR', fopen('php://stderr', 'w'));
* Minimal command line test displayer. Writes fail details to STDERR. Returns 0
* to the shell if all tests pass, ST_FAILS_RETURN_CODE if any test fails.
if (! is_null($faildetail_separator)) {
* Return a formatted faildetail for printing.
$faildetail =
$this->getTestList();
* Paint fail faildetail to STDERR.
parent::paintFail($message);
* Paint exception faildetail to STDERR.
parent::paintException($message);
* Paint a footer with test case name, timestamp, counts of fails and
$buffer =
$this->getTestCaseProgress() .
'/' .
$this->getTestCaseCount() .
' test cases complete: ';
if (0 <
($this->getFailCount() +
$this->getExceptionCount())) {
$buffer .=
$this->getPassCount() .
" passes";
if (0 <
$this->getFailCount()) {
$buffer .=
", " .
$this->getFailCount() .
" fails";
if (0 <
$this->getExceptionCount()) {
$buffer .=
", " .
$this->getExceptionCount() .
" exceptions";
fwrite(STDOUT, $buffer .
$this->getPassCount() .
" passes.\n");
Documentation generated on Thu, 08 Jan 2009 17:38:14 +0100 by phpDocumentor 1.4.0a2