2010-11-30 7 views
1

"cake bake testsuit"를 통해 testuits를 생성하고 내 응용 프로그램에 localhost/test.php를 사용했습니다. 그래서 테스트 중 하나를 실행하려고하면 오류가 발생합니다 (다른 테스트는 유효합니다) : CakePHP 치명적인 오류 : 'ErrorHandler'클래스를 찾을 수 없습니다.

 
Fatal error: Class 'ErrorHandler' not found in Z:\home\prodvigator\www\cake\libs\object.php on line 201 
이 모델과 컨트롤러는 스캐 폴드에 의해 생성되며이 소스에 오류가 있다고 생각하지 않습니다.

사용 : 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> 

나는 g 컨트롤러뿐만 아니라에서 응용 프로그램 \ 컨트롤러 \ 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(); 
     } 
    } 
?> 
관련 문제