我已经通过“蛋糕烘焙测试服”生成了测试服,并为我的应用程序使用了 localhost/test.php。 因此,当我尝试运行其中一项测试时出现错误(其他测试有效):
Fatal error: Class 'ErrorHandler' not found in Z:\home\prodvigator\www\cake\libs\object.php on line 201
这个模型和控制器是由脚手架生成的,我不认为这个来源有错误。
使用: 蛋糕PHP 1.3 最新的简单测试
就我而言,删除文件夹中的所有文件
/app/tmp/cache/persistent
解决了问题。
尝试检查生成的测试是否存在写入文件顶部的错误。
有时我会在模型和控制器测试中找到类似的东西。
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
就我而言,错误是:
Fatal error: Uncaught Error: Class 'ErrorHandler' not found in C:\[path]\core\cake\libs\object.php on line 211
( ! ) Error: Class 'ErrorHandler' not found in C:\[path]\core\cake\libs\object.php on line 211
尝试访问 http://localhost/user_accounts/index
时发生错误我已经在 app iews\user_accounts\index.ctp 中创建了包含以下内容的视图:
<div>
Text from div
</div>
我也在 ap 创建了相应的控制器