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');
精彩评论