【发布时间】:2012-11-08 08:41:15
【问题描述】:
我已经用 Zend Framework 配置了 PHPUnit。当我运行命令时
phpunit --configuration phpunit.xml
我收到类似的失败消息
Declaration of Zend_Test_PHPUnit_Constraint_ResponseHeader::evaluate() should be compatible with that of PHPUnit_Framework_Constraint::evaluate()
我有以下assert 函数
$this->assertModule($urlParams['module']);
$this->assertController($urlParams['controller']);
$this->assertAction($urlParams['action']);
$this->assertResponseCode(200);
我搜索了问题并找到了许多相关的解决方案,例如here。我检查了我的 PHPUnit 版本,它是 3.7.9,而 Zend Framework 1 只能与 PHPUnit 3.5.x 一起正常工作。
然后我尝试按照here 的说明降级PHPUnit。 un-installation 进程成功运行。但是当我去安装降级版本并运行命令时
pear install phpunit/PHP_CodeCoverage-1.0.2
它会产生错误
phing/phing requires package "phpunit/PHP_CodeCoverage" (version >= 1.1.0). phpunit/PHP_CodeCoverage cannot be installed, Conflicts with installed packages.
有人告诉我如何处理这种情况?如何使安装的 PHPUnit 版本与 Zend Framework 1.X 兼容或如何正确降级我的 PHPUnit??
最好的问候。
【问题讨论】:
标签: zend-framework phpunit pear phing zend-test