简体   繁体   English

Zend Test assertResponseCode与PHPUnit不兼容?

[英]Zend Test assertResponseCode incompatible with PHPUnit?

I am trying to use Zend Test and PHPUnit to test an application I've built. 我正在尝试使用Zend Test和PHPUnit测试我构建的应用程序。 I'm just in the early stages of getting things setup and have run into some problems ( see this fun problem ). 我只是在开始进行设置的初期阶段,遇到了一些问题( 请参阅此有趣的问题 )。 But besides PHPUnit not being able to write the log file for whatever reason, the tests do run just fine (seemingly). 但是除了PHPUnit出于某种原因不能写日志文件之外,测试确实运行良好(貌似)。 However, if I try to use $this->assertResponseCode(200, 'some message'); 但是,如果我尝试使用$this->assertResponseCode(200, 'some message'); I get the following error: 我收到以下错误:

Declaration of Zend_Test_PHPUnit_Constraint_ResponseHeader::evaluate() should be compatible with PHPUnit_Framework_Constraint::evaluate($other, $description = '', $returnResult = false)

I've looked at the Zend Test code, and I'm pretty sure I'm passing the correct parameters. 我已经看过Zend测试代码,而且我很确定自己传递了正确的参数。 I've also searched for my issues and found this question . 我还搜索了我的问题并找到了这个问题 Any ideas on what I'm doing wrong? 关于我在做什么错的任何想法吗?

I'm running the latest PHPUnit (3.6.12) from here and PHP 5.4 on Windows. 我从这里运行最新的PHPUnit(3.6.12),在Windows上运行PHP 5.4。

From http://framework.zend.com/issues/browse/ZF-11828 : http://framework.zend.com/issues/browse/ZF-11828

Closing as won't fix due to a collection of reasons: 由于多种原因,无法按如下方式关闭:

Matthew has stated repeatedly that PHPUnit 3.4.x is the officially-supported version of ZFv1 Repeated attempts (both official and unofficial) have not yielded a workable PHAR archive of PHPUnit 3.4.x which could be bundled with ZFv1 Alternate solutions exist (ie: altroot PEAR install + PHPUnit 3.4.x) Matthew反复指出,PHPUnit 3.4.x是ZFv1的官方支持版本。反复尝试(正式的和非官方的)都没有产生可与ZFv1捆绑在一起的PHPUnit 3.4.x的可行PHAR存档。存在替代解决方案(即:altroot) PEAR安装+ PHPUnit 3.4.x)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM