【发布时间】:2013-01-14 18:16:28
【问题描述】:
经过认真调试后,我发现在使用 EcomDev_PHPUnit 模块运行测试时,我无法调用 Magento 中的会话对象
任何单例/模型调用,即Mage::getSingleton('admin/session') 或Mage::getModel('customer/session') 最终都会从EcomDev_PHPUnit_Controller_Request_Http::getHttpHost() 抛出异常,说Cannot run controller test, because the host is not set for base url.,这是因为未设置$_SERVER['HTTP_HOST'] 索引而引起的
配置中是否有我可能缺少的东西导致这种情况?
【问题讨论】:
标签: unit-testing magento testing phpunit