mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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.
This commit is contained in:
parent
82a1bd6f80
commit
e7ff0bdf66
2 changed files with 14 additions and 3 deletions
|
@ -386,8 +386,12 @@ class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
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 @@ class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
|
||||
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 @@ class CakeHtmlReporter extends CakeBaseReporter implements PHPUnit_Framework_Tes
|
|||
|
||||
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";
|
||||
|
|
Loading…
Add table
Reference in a new issue