调用未定义的方法 PHP_CodeCoverage_Filter::getInstance() [英] Call to undefined method PHP_CodeCoverage_Filter::getInstance()

查看:32
本文介绍了调用未定义的方法 PHP_CodeCoverage_Filter::getInstance()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的系统 (Ubuntu 11) 上安装了 PHPUnit 的新副本,但是每当我在控制台中键入 phpunit 时,我都会收到以下错误:

I've got a fresh copy of PHPUnit installed on my system (Ubuntu 11), but whenever I type phpunit in the console I get the following error:

PHP 致命错误:调用第 39 行/usr/bin/phpunit 中未定义的方法 PHP_CodeCoverage_Filter::getInstance()

据我所知,我已经安装了 PHPUnit 的代码覆盖率:

I have PHPUnit's code coverage installed, as far as I know:

>sudo pear install phpunit/PHP_CodeCoverage

phpunit/PHP_CodeCoverage 已经安装,与发布的1.1.1版本一致

安装失败

为什么我会收到这个错误,我该如何解决?

Why am I getting this error and how can I fix it?

推荐答案

加载 PHPUnit 的可执行脚本在升级到 3.6.x 时必须没有更新.重新安装.

The executable script that loads PHPUnit must not have been updated when going to 3.6.x. Reinstall it.

sudo pear uninstall phpunit/PHPUnit
sudo pear install phpunit/PHPUnit

如果这不起作用,确保 PEAR 本身是最新的.

这篇关于调用未定义的方法 PHP_CodeCoverage_Filter::getInstance()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆