pass('Expected results received');
return;
}
$iLen = count($aExpected);
for ($c = 0; $c < $iLen; $c++) {
if ($aReceived[$c] != $aExpected[$c]) {
$this->fail(sprintf("Failure. Expected %s, but got %s\n", $aExpected[$c], $aReceived[$c]));
}
}
}
function assertEntity($oEntity, $sClass) {
if (is_a($oEntity, $sClass)) {
return $this->pass(sprintf('Object is a %s', $sClass));
}
return $this->fail(sprintf('Object is not a %s', $sClass));
}
function assertNotError($oObject) {
if(PEAR::isError($oObject)) {
return $this->fail(sprintf('Object is a PEAR Error: '.$oObject->getMessage() ));
}
return $this->pass(sprintf('Object is not a PEAR Error'));
}
function assertError($oObject) {
if(PEAR::isError($oObject)) {
return $this->pass(sprintf('Object is a PEAR Error: '.$oObject->getMessage() ));
}
return $this->fail(sprintf('Object is not a PEAR Error'));
}
function assertGroup($oGroup) {
return $this->assertEntity($oGroup, 'Group');
}
}
/**
* Extends the HTML reporter to display more information
*
*/
class KTHtmlReporter extends HtmlReporter {
/**
* Display the passed tests
*
* @param string $message Display a custom message for the test
*/
function paintPass($message) {
parent::paintPass($message);
print "Pass: ";
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
print implode("->", $breadcrumb);
print "->$message
\n";
}
/**
* Display the start of each method
*
* @param string $test_name
*/
function paintMethodStart($test_name) {
parent::paintMethodStart($test_name);
print "
Method start: $test_name
";
}
/**
* Display the start of each test case
*
* @param string $test_case
* @param int $size
*/
function paintGroupStart($test_case, $size) {
parent::paintGroupStart($test_case, $size);
print "