【发布时间】:2014-09-25 06:57:43
【问题描述】:
我有一个扩展 MyCustom_Controller_Action 的 IndexContoller,它扩展 Zend_Controller_Action。
我注意到我的集成测试(当我执行$this->dispatch('/') 时)从未触发我的 IndexController、MyCustom_Controller_Action 或 Zend_Controller_Action 的 preDispatch 方法。但是,这些类的 init() 方法可以访问。
如何修复我的测试设置,以便也调用 preDispatch 函数(就像在我的生产应用程序的正常流程中一样)?
(需要调用它们,否则我无法测试应用程序中实际发生的情况。)
PHPUnit 3.5.15
Zend 框架 1.12
【问题讨论】:
标签: php zend-framework phpunit integration-testing