0
我是新来测试并尝试在Zend Framework应用程序中进行设置。该应用仅适用于登录用户。登录页面使用不同的布局比应用Zend PHPUnit未初始化布局
LoginController.php包含的休息:
public function init()
{
$this->_helper->layout()->setLayout('loginlayout');
parent::init();
}
然而,建立一个测试,测试的LoginController,使这是指我们的主要布局异常。所以看起来这个init()代码被测试忽略,并且没有设置正确的布局。
这里是我使用的测试代码:
class LoginControllerTest extends ControllerTestCase
{
public function testCanDoUnitTest()
{
$this->dispatch('/login');
$this->assertController('login');
$this->assertAction('index');
$this->assertResponseCode(200);
}
}
任何帮助,将不胜感激。