Skip to content
Permalink
Browse files

Adding missing parameters to assertEqual() wrapper.

Adding assertNotEqual() wrapper.
Adding expectError() but it doesn't work because of Debugger's error handler being set.
Fixing fatal error where getDescription would not be defined.
  • Loading branch information...
markstory committed May 8, 2010
1 parent 82a1bd6 commit e7ff0bdf661f2b2ebee386bc235a699b756d3e8a
Showing with 14 additions and 3 deletions.
  1. +13 −2 cake/tests/lib/cake_test_case.php
  2. +1 −1 cake/tests/lib/reporter/cake_html_reporter.php
@@ -386,8 +386,12 @@ private function __array_permute($items, $perms = array()) {
}
}
protected function assertEqual($a, $b) {
return $this->assertEquals($a, $b);
protected function assertEqual($a, $b, $message = '') {
return $this->assertEquals($a, $b, $message);
}
protected function assertNotEqual($a, $b, $message = '') {
return $this->assertNotEquals($a, $b, $message);
}
protected function assertPattern($pattern, $string, $message = '') {
@@ -404,6 +408,13 @@ protected function assertNoPattern($pattern, $string, $message = '') {
protected function assertNoErrors() {
}
protected function expectError($expected = false, $message = '') {
if (!$expected) {
$expected = 'Exception';
}
$this->setExpectedException($expected, $message);
}
protected function expectException($name = null) {
$this->setExpectedException($name);
@@ -257,7 +257,7 @@ public function paintFail($message) {
echo "<li class='fail'>\n";
echo "<span>Failed</span>";
echo "<div class='msg'><pre>" . $this->_htmlEntities($message->getDescription()) . "</pre></div>\n";
echo "<div class='msg'><pre>" . $this->_htmlEntities($message->toString()) . "</pre></div>\n";
echo "<div class='msg'>" . sprintf(__('File: %s'), $context['file']) . "</div>\n";
echo "<div class='msg'>" . sprintf(__('Method: %s'), $realContext['function']) . "</div>\n";
echo "<div class='msg'>" . sprintf(__('Line: %s'), $context['line']) . "</div>\n";

0 comments on commit e7ff0bd

Please sign in to comment.
You can’t perform that action at this time.