Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing php4 issues in ErrorHandler and ErrorHandler testcase.

  • Loading branch information...
commit 3a38e0869fdecdecadf89ca27ca8909ec62c9bc3 1 parent 547aa76
Mark Story markstory authored
Showing with 7 additions and 5 deletions.
  1. +2 −2 cake/libs/error.php
  2. +5 −3 cake/tests/cases/libs/error.test.php
4 cake/libs/error.php
View
@@ -112,8 +112,8 @@ function __construct($method, $messages) {
if (strtolower($parentClass) != 'errorhandler') {
$method = 'error404';
}
- $parentMethods = get_class_methods($parentClass);
- if (in_array($method, $parentMethods)) {
+ $parentMethods = array_map('strtolower', get_class_methods($parentClass));
+ if (in_array(strtolower($method), $parentMethods)) {
$method = 'error404';
}
if (isset($code) && $code == 500) {
8 cake/tests/cases/libs/error.test.php
View
@@ -279,19 +279,21 @@ function testSubclassMethodsNotBeingConvertedToError() {
$back = Configure::read('debug');
Configure::write('debug', 2);
ob_start();
- $ErrorHandler = new MyCustomErrorHandler('missingWidgetThing', array('message' => 'doh!'));
+ $ErrorHandler =& new MyCustomErrorHandler('missingWidgetThing', array('message' => 'doh!'));
$result = ob_get_clean();
$this->assertEqual($result, 'widget thing is missing');
Configure::write('debug', 0);
ob_start();
- $ErrorHandler = new MyCustomErrorHandler('missingWidgetThing', array('message' => 'doh!'));
+ $ErrorHandler =& new MyCustomErrorHandler('missingWidgetThing', array('message' => 'doh!'));
$result = ob_get_clean();
$this->assertEqual($result, 'widget thing is missing', 'Method declared in subclass converted to error404. %s');
Configure::write('debug', 0);
ob_start();
- $ErrorHandler = new MyCustomErrorHandler('missingController', array('message' => 'Page not found'));
+ $ErrorHandler =& new MyCustomErrorHandler('missingController', array(
+ 'className' => 'Missing', 'message' => 'Page not found'
+ ));
$result = ob_get_clean();
$this->assertPattern('/Not Found/', $result, 'Method declared in error handler not converted to error404. %s');
Please sign in to comment.
Something went wrong with that request. Please try again.