Unit testing Cakephp-测试组件-找不到组件
我正在用cakephp编写一个组件测试 这是我的密码Unit testing Cakephp-测试组件-找不到组件,unit-testing,cakephp,Unit Testing,Cakephp,我正在用cakephp编写一个组件测试 这是我的密码 <?php class PermissionTestCase extends CakeTestCase { var $fixtures = array('Org'); function testsetPermission() { $this->PermissionComponentTest = new PermissionComponent(); <---- line 5 您必须使用App
<?php
class PermissionTestCase extends CakeTestCase {
var $fixtures = array('Org');
function testsetPermission() {
$this->PermissionComponentTest = new PermissionComponent(); <---- line 5
您必须使用App::import()手动包含该组件:
谢谢,成功了!我尝试过,var$components=array('Permission');
App::import('Component', 'Permission');