2010-11-30 198 views
1

我已经通过“蛋糕烘烤测试套件”生成了测试套件,并使用localhost/test.php作为我的应用。 所以,当我试图运行其中一个测试(其他测试是有效的)时,这是一个错误: CakePHP致命错误:找不到类'ErrorHandler'

 
Fatal error: Class 'ErrorHandler' not found in Z:\home\prodvigator\www\cake\libs\object.php on line 201 
这个模型和控制器是由scaffold生成的,我不认为这个错误来源于此。

使用: CakePHP的1.3 最新SimpleTest的

回答

0

尝试检查,使程序在该文件的顶部写了一个错误生成的测试。

有时我已经知道在模型和控制器测试中都能找到类似的东西。

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 
0

在我的情况下,错误是:

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

我已经在应用程序创建视图时错误是发生在我身上\意见\ user_accounts \ index.ctp,含以下内容:

<div> 
    Text from div 
</div> 

我已经创建了收藏克控制器以及在应用\控制器\ user_accounts_controller.php:

<?php 
    class UserAccountsController extends AppController { 
     public function index() { 
      // Render the view in /views/user_accounts/index.ctp 
      $this->render(); 
     } 
    } 
?> 

由于我不相关联的模型到该控制器,我是缺少这样的:var $uses = array();。如果错误更加明确,它会为我节省时间,比如“您没有与此控制器关联的模型”。

此修复程序是:

<?php 
    class UserAccountsController extends AppController { 
     // Use this controller without a need for a corresponding Model file. 
     var $uses = array(); 
     public function index() { 
      // Render the view in /views/user_accounts/index.ctp 
      $this->render(); 
     } 
    } 
?> 
相关问题