【发布时间】:2017-02-09 16:16:30
【问题描述】:
我正在使用 Zend 框架,我已经设置了所有东西,但是在单元测试中我遇到了一个致命错误:
c:\xampp\htdocs\zend\module\Album\test>phpunit PHP Catchable 致命错误:传递给 Zend\ServiceManager\ServiceManager::__construct() 的参数 1 必须是数组类型,给定对象,在 C:\xampp\htdocs\zend\module\Album\test\Bootstrap.php 中调用第 53 行并在第 144 行的 c:\xampp\htdocs\zend\vendorframework\zend-servicemanager\src\ServiceManager.php 中定义
Bootstrap.php 第 52-58 行:
$config = ArrayUtils::merge($baseConfig, $testConfig);
$serviceManager = new ServiceManager(new ServiceManagerConfig());
$serviceManager->setService('ApplicationConfig', $config);
$serviceManager->get('ModuleManager')->loadModules();
static::$serviceManager = $serviceManager;
static::$config = $config;
ServiceManager.php 第 144-148 行:
public function __construct(array $config = [])
{
$this->creationContext = $this;
$this->configure($config = []);
}
请给点建议???
【问题讨论】:
标签: php zend-framework phpunit