【问题标题】:phpunit setup not picking up replacement versionphpunit 设置没有选择替换版本
【发布时间】:2013-08-25 05:19:01
【问题描述】:

我正在尝试按照本教程将 phpunit 版本更改为 3.5 http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/

似乎安装了正确的文件,但我收到类似的错误

root@gerard:/home/gerard/sites/zf# phpunit /var/www/tests/unittests.php

PHPUnit 3.7.24 by Sebastian Bergmann.

.PHP Fatal error:  Call to undefined method RemoteConnectTest::hasPerformedExpectationsOnOutput() in phar:///usr/local/bin/phpunit/PHPUnit/TextUI/ResultPrinter.php on line 628

&&

root@gerard:/home/gerard/sites/zf# phpunit --version

PHPUnit 3.7.24 by Sebastian Bergmann.

//显示错误的版本

正确的文件似乎都安装在 /usr/share/php/PHPUnit /usr/share/php/PHPUnit/Runner/Version.php 中显示的版本是“Sebastian Bergmann 的 PHPUnit 3.5.15。”

谢谢

【问题讨论】:

    标签: php unit-testing zend-framework phpunit pear


    【解决方案1】:

    您可能需要更新 phpunit 二进制 PATH。您可以通过以下方式检查此命令的路径:

    which phpunit
    

    如果它指向 3.7 文件夹,将其更改为 3.5 文件夹应该可以解决问题。

    如果这不起作用,则删除两个版本并重新安装 3.5 以及所有正确的依赖项。我过去也遇到过类似的问题,删除它并从头开始会更快。

    【讨论】:

    • 确实是这样的。当我删除 3.6 并安装 3.5 时,phpunit 命令指向仍然存在的旧文件。该版本在该文件和 framework/runner/version.php 中都被硬编码
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-08
    • 1970-01-01
    • 1970-01-01
    • 2017-02-10
    • 1970-01-01
    • 2012-01-16
    • 1970-01-01
    相关资源
    最近更新 更多