問題描述
我正在嘗試使用 PHPUnit 3.6.4 對我的 Zend Framework 應用程序進行單元測試.當我在命令提示符中嘗試此命令時,出現以下錯誤.
I am trying to unit test my Zend Framework application using PHPUnit 3.6.4. I get the following error when i try this command in my command prompt.
C:xampphtdocs estsample ests>phpunit --configuration phpunit.xml
PHPUnit 3.6.4 by Sebastian Bergmann.
Configuration read from C:xampphtdocs estsample estsphpunit.xml
←[31;1mE←[0m←[31;1mE←[0m..
Time: 0 seconds, Memory: 10.00Mb
There were 2 errors:
1) IndexControllerTest::testIndexWithMessageAction
Declaration of Zend_Test_PHPUnit_Constraint_DomQuery::evaluate() should be compatible
with that of PHPUnit_Framework_Constraint::evaluate()
C:xampphtdocshivelibraryendTestPHPUnitConstraintDomQuery.php:40
C:xampphtdocshivelibraryendTestPHPUnitControllerTestCase.php:512
C:xampphtdocs estsample estsapplicationcontrollersIndexControllerTest.php
:14
C:xamppphpPEARPHPUnitFrameworkTestCase.php:925
C:xamppphpPEARPHPUnitFrameworkTestCase.php:787
C:xamppphpPEARPHPUnitFrameworkTestResult.php:649
C:xamppphpPEARPHPUnitFrameworkTestCase.php:734
C:xamppphpPEARPHPUnitFrameworkTestSuite.php:772
C:xamppphpPEARPHPUnitFrameworkTestSuite.php:745
C:xamppphpPEARPHPUnitFrameworkTestSuite.php:705
C:xamppphpPEARPHPUnitTextUITestRunner.php:325
C:xamppphpPEARPHPUnitTextUICommand.php:187
C:xamppphpPEARPHPUnitTextUICommand.php:125
C:xamppphpphpunit:44
2) IndexControllerTest::testIndexNoMessageAction
Declaration of Zend_Test_PHPUnit_Constraint_ResponseHeader::evaluate() should be
compatible with that of PHPUnit_Framework_Constraint::evaluate()
C:xampphtdocshivelibraryendTestPHPUnitConstraintResponseHeader.php:400
C:xampphtdocshivelibraryendTestPHPUnitControllerTestCase.php:769
C:xampphtdocshivelibraryendTestPHPUnitControllerTestCase.php:769
C:xampphtdocs estsample estsapplicationcontrollersIndexControllerTest.php
:22
C:xamppphpPEARPHPUnitFrameworkTestCase.php:925
C:xamppphpPEARPHPUnitFrameworkTestCase.php:787
C:xamppphpPEARPHPUnitFrameworkTestResult.php:649
C:xamppphpPEARPHPUnitFrameworkTestCase.php:734
C:xamppphpPEARPHPUnitFrameworkTestSuite.php:772
C:xamppphpPEARPHPUnitFrameworkTestSuite.php:745
C:xamppphpPEARPHPUnitFrameworkTestSuite.php:705
C:xamppphpPEARPHPUnitTextUITestRunner.php:325
C:xamppphpPEARPHPUnitTextUICommand.php:187
C:xamppphpPEARPHPUnitTextUICommand.php:125
C:xamppphpphpunit:44
←[37;41m←[2KFAILURES!
←[0m←[37;41m←[2KTests: 4, Assertions: 10, Errors: 2.
←[0m←[2K
Generating code coverage report, this may take a moment.
為什么我會收到這個錯誤?我做錯了什么?請幫幫我
Why am i getting this error? What is that I've done wrong? Please help me
推薦答案
Zend Framework 1 應用程序當前,可能在相當長一段時間內,只能使用 PHPUnit 3.5.x
正常運行.
Zend Framework 1 applications currently, and possibly for quite some time, only function properly using PHPUnit 3.5.x
.
請參見將phpunit 3.6降級到3.5.15
關于如何降級到 3.5
.
Please see downgrade phpunit 3.6 to 3.5.15
on how to downgrade to 3.5
.
Zend Framework 2 將再次支持當前版本的 PHPUnit
.
Zend Framework 2 will support the current version of PHPUnit
again.
這篇關于Zend_Test_PHPUnit_Constraint_DomQuery::evaluate() 的聲明應該與 PHPUnit_Framework_Constraint::evaluate() 的聲明兼容的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!