【发布时间】:2013-03-12 15:27:21
【问题描述】:
所以我创建了我的自定义视图助手并在 layout.phtml 中使用它,如下所示:
<?php echo $this->applicationBar(); ?>
它在浏览器中运行完美,但我之前运行的单元测试现在失败了:
1) UnitTests\Application\Controller\IndexControllerTest::testIndexActionCanBeAccessed
Zend\ServiceManager\Exception\ServiceNotFoundException: Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for applicationBar
当我在布局文件中注释掉视图助手时,测试再次通过。
【问题讨论】: