【发布时间】:2014-09-01 05:16:25
【问题描述】:
一直在尝试将 PHPUnit 与 CIUnit 一起使用,以便使用 codeigniter 完成测试,但在尝试指向我的 phpunit 安装时出现此错误。
PHPUnit 安装在这里,路径在配置文件中设置:
/home/web/phpunit/PHPUnit/
在codeigniter的tests目录上
/home/web/web.com/codeigniter/tests
$ phpunit
Fatal error: Class 'PHPUnit_Util_Filesystem' not found in /home/web/phpunit/PHPUnit/Autoload.php on line 209
违规行:
if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('PHP/Invoker/Autoload.php')) {
require_once 'PHP/Invoker/Autoload.php';
}
PHPUnit 文件夹的目录没有 Util 文件夹,但我手动添加了它,其中有一个 Filesystem.php 但不确定为什么即使手动添加它也无法正确访问。任何帮助表示赞赏。
更新: 能够使用 phar 文件使用 PHPUnit。现在我遇到了类似的错误,但能够在 phpunit-master 目录上运行其他测试。
我现在得到这个错误:
Fatal error: Call to undefined method PHPUnit_Util_Filesystem::fileExistsInIncludePath() in /home/web/web.com/codeigniter/application/third_party/CIUnit/PHPUnit/Autoload.php on line 209
该函数确实存在并且在文件系统中。第 92 行
public static function fileExistsInIncludePath($file)
所以现在不确定是什么问题。
【问题讨论】:
-
你是如何安装
phpunit的? -
@zerkms 第一次迭代使用的是 zip 文件,但随后下载了 phar 文件 phpunit.de/getting-started.html 也许我应该删除由 zip 文件创建的旧 phpunit?
标签: php codeigniter phpunit