【发布时间】:2011-07-02 03:08:46
【问题描述】:
标题几乎说明了一切。我想测试例如UsersController::admin_index() 操作,但需要授权用户访问此位置,因此当我运行测试时,它会将我发送到登录页面,即使我手动登录,也没有完成任何测试。
那么如何在不编辑实际授权码的情况下强制 cake 跳过授权呢?
顺便说一句,如果有帮助,我的testAdminIndex() 代码如下所示:
function testAdminIndex() {
$result = $this->testAction('/admin/users/index');
debug($result);
}
【问题讨论】:
标签: php unit-testing authorization cakephp-1.3 simpletest