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);
}
}
任何幫助,將不勝感激。