开发者

Cakephp - Testing Components - cannot find component

I am writing a component test in cakephp here is my code

<?php
  class PermissionTestCase extends CakeTestCase {
   var $f开发者_JAVA百科ixtures = array('Org');  
   function testsetPermission() { 
      $this->PermissionComponentTest = new PermissionComponent(); <---- line 5

I get this error - Fatal error: Class 'PermissionComponent' not found in /Sites/php/cake/Demo_Code/perm/app/tests/cases/components/permission.test.php on line 5

Why is it looking for the component in tests/cases ? Also I tried moving the component into this directory and it didnt work.

Thanks

Alex


You have to include the component manually with App::import():

App::import('Component', 'Permission');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜