views:

15

answers:

1

Hi,

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

<?php
  class PermissionTestCase extends CakeTestCase {
   var $fixtures = 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

+2  A: 

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

App::import('Component', 'Permission');
dhofstet
Thanks, That worked! I tried, var $components = array('Permission');
Alex