Search code examples
unit-testingcakephperror-handling

CakePHP fatal error: Class 'ErrorHandler' not found


I've generated testsuits via "cake bake testsuit" and used localhost/test.php for my app. So, the is an error when I tried to run one of test (else tests are valid):

Fatal error: Class 'ErrorHandler' not found in Z:\home\prodvigator\www\cake\libs\object.php on line 201
This models and controllers are generated by scaffold and I don't think that an error is in this sources.

Using: CakePHP 1.3 The latest SimpleTest


Solution

  • try checking the generated tests for an error that gets written at the top of the file.

    sometimes i've been known to find something like this in both model and controller tests.

    Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /projectname/cake/console/templates/default/classes/test.ctp on line 22