gpt4 book ai didi

php - Zend_Test_PHPUnit_Constraint_DomQuery::evaluate() 的声明应该与 PHPUnit_Framework_Constraint::evaluate() 的声明兼容

转载 作者:行者123 更新时间:2023-12-03 00:51:39 28 4
gpt4 key购买 nike

我正在尝试使用 PHPUnit 3.6.4 对我的 Zend Framework 应用程序进行单元测试。当我在命令提示符中尝试此命令时,出现以下错误。

C:\xampp\htdocs\testsample\tests>phpunit --configuration phpunit.xml
PHPUnit 3.6.4 by Sebastian Bergmann.

Configuration read from C:\xampp\htdocs\testsample\tests\phpunit.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:\xampp\htdocs\hive\library\Zend\Test\PHPUnit\Constraint\DomQuery.php:40
C:\xampp\htdocs\hive\library\Zend\Test\PHPUnit\ControllerTestCase.php:512
C:\xampp\htdocs\testsample\tests\application\controllers\IndexControllerTest.php
:14
C:\xampp\php\PEAR\PHPUnit\Framework\TestCase.php:925
C:\xampp\php\PEAR\PHPUnit\Framework\TestCase.php:787
C:\xampp\php\PEAR\PHPUnit\Framework\TestResult.php:649
C:\xampp\php\PEAR\PHPUnit\Framework\TestCase.php:734
C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:772
C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:745
C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:705
C:\xampp\php\PEAR\PHPUnit\TextUI\TestRunner.php:325
C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php:187
C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php:125
C:\xampp\php\phpunit:44

2) IndexControllerTest::testIndexNoMessageAction
Declaration of Zend_Test_PHPUnit_Constraint_ResponseHeader::evaluate() should be
compatible with that of PHPUnit_Framework_Constraint::evaluate()

C:\xampp\htdocs\hive\library\Zend\Test\PHPUnit\Constraint\ResponseHeader.php:400

C:\xampp\htdocs\hive\library\Zend\Test\PHPUnit\ControllerTestCase.php:769
C:\xampp\htdocs\hive\library\Zend\Test\PHPUnit\ControllerTestCase.php:769
C:\xampp\htdocs\testsample\tests\application\controllers\IndexControllerTest.php
:22
C:\xampp\php\PEAR\PHPUnit\Framework\TestCase.php:925
C:\xampp\php\PEAR\PHPUnit\Framework\TestCase.php:787
C:\xampp\php\PEAR\PHPUnit\Framework\TestResult.php:649
C:\xampp\php\PEAR\PHPUnit\Framework\TestCase.php:734
C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:772
C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:745
C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:705
C:\xampp\php\PEAR\PHPUnit\TextUI\TestRunner.php:325
C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php:187
C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php:125
C:\xampp\php\phpunit:44

←[37;41m←[2KFAILURES!
←[0m←[37;41m←[2KTests: 4, Assertions: 10, Errors: 2.
←[0m←[2K
Generating code coverage report, this may take a moment.

为什么我会收到此错误?我到底做错了什么?请帮助我

最佳答案

Zend Framework 1 应用程序当前(并且可能在相当长的一段时间内)只能使用 PHPUnit 3.5.x 正常运行。

请参阅downgrade phpunit 3.6 to 3.5.15关于如何降级到 3.5

Zend Framework 2 将再次支持当前版本的 PHPUnit

关于php - Zend_Test_PHPUnit_Constraint_DomQuery::evaluate() 的声明应该与 PHPUnit_Framework_Constraint::evaluate() 的声明兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8389732/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com