require_once(PHP/CodeCoverage/Filter.php): 无法打开流

require_once(PHP/CodeCoverage/Filter.php): failed to open stream

我正在尝试熟悉 Symfony 2.3.24/Windows7/PHP 5.4.7.

下的测试(单元、功能)

似乎 PHPUnit 已正确安装(通过 Composer),但是当我 运行 执行 phpunit -c app/ 命令时,出现以下错误:

Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in C:\xampp\php\phpunit on line 38

Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\php\phpunit on line 38

我用谷歌搜索了这个问题,但没有结果。我在官方 PHPUnit 网站上还发现 The code coverage report feature requires the Xdebug (2.1.3 or later) and tokenizer extensions.

你怎么看这一切?非常感谢您的帮助。

在当前版本的 PHPUnit 中,phpunit 脚本不直接包含 PHP/CodeCoverage/Filter.php。看来您使用的是过时版本的 PHPUnit and/or 混淆了 Composer/PEAR 个安装。

请按照说明进行操作 https://phpunit.de/getting-started.html to properly install PHPUnit. And http://thephp.cc/news/2015/01/phpunit-migration-from-pear-to-phar 解释了如何从基于 PEAR 的安装迁移到 Composer 或 PHAR。