PHP Notice: Please no longer include "PHPUnit/Framework.php". 解决办法
2011-09-15 09:16
435 查看
今天在学习Yii Framework中单元测试时,总是在运行“phpunit unit/DBTest.php”命令的时候出现以下错误,
PHP Notice: Please no longer include "PHPUnit/Framework.php". in /usr/share/php/PHPUnit/Framework.php on line 50
但自己是按照文档上说的安装了PHPUnit包了呀,后来发现想起来安装过程中由于家里网络问题其中一个依赖包出错了,但是别的包都提示安装成功了,然后自己是把那个失败的包PHP_CodeCoverage重新安装的,然后运行unit的时候就出现了上面的错误,于是自己慢慢摸索,然后做了以下步骤后,问题总算被解决了。
1. 打开pear的auto_discover选项
PHP Notice: Please no longer include "PHPUnit/Framework.php". in /usr/share/php/PHPUnit/Framework.php on line 50
但自己是按照文档上说的安装了PHPUnit包了呀,后来发现想起来安装过程中由于家里网络问题其中一个依赖包出错了,但是别的包都提示安装成功了,然后自己是把那个失败的包PHP_CodeCoverage重新安装的,然后运行unit的时候就出现了上面的错误,于是自己慢慢摸索,然后做了以下步骤后,问题总算被解决了。
1. 打开pear的auto_discover选项
$ sudo pear config-set auto_discover 12. 检查已经安装的phpunit和其依赖包
$ sudo pear list -a Installed packages, channel pear.phpunit.de: ============================================ Package Version State DbUnit 1.0.3 stable File_Iterator 1.2.6 stable PHPUnit 3.5.15 stable PHPUnit_MockObject 1.0.9 stable PHPUnit_Selenium 1.0.3 stable PHP_CodeCoverage 1.0.5 stable PHP_Timer 1.0.2 stable PHP_TokenStream 1.0.1 stable Text_Template 1.1.0 stable3. 卸载所有pear.phpunit.de channel下安装的和phpunit相关的包,这里有先后顺序,卸载的时候会有提示
$ sudo pear uninstall PHPUnit $ sudo pear uninstall PHPUnit_MockObject ...4. 重新安装PHPUnit包
$ sudo pear install pear.phpunit.de/PHPUnit5. 再次运行“phpunit unit/DBTest.php”,问题解决。
相关文章推荐
- PHP Notice: Please no longer include "PHPUnit/Framework.php". 解决办法
- 安装Apache时,系统找不到指定的文件 No installed service named "Apache2"的解决办法
- 生成JNI的DLL时提示找不到jni.h的解决办法Cannot open include file: 'jni.h': No such file or directory
- Keil编译出现“Error: L6406W: No space in execution regions with .ANY selector match Section"的解决办法
- MAC下wireshark "No interface found"解决办法
- the project file '' has been renamed or is no longer in the solution 解决办法
- no rule to process file "xxxxxxxxx" of type XXXXXX.h for architecture i386解决办法
- nginx运行php"No input file specified"错误的解决方法
- dede DedeCMS Error:Tag disabled:"php" more...! 错误解决的办法
- PHP date("Y-m-d H:i:s");获取当前时间 差8小时解决办法
- VMware下Linux安装VMWare Tools 后无法启动图形界面,出现"no screens found" 的解决办法
- vtk使用过程中出现 "no override found for ***"错误的解决办法
- 生成JNI的DLL时提示找不到jni.h的解决办法Cannot open include file: 'jni.h': No such file or directory
- testsaslauthd出现0: NO "authentication failed"错误提示的解决办法
- MySQL同步故障:" Slave_SQL_Running:No" 两种解决办法
- 关于OpenSUSE安装HLA编译时,提示:Could not open include file "stdlib.hhf" 的解决办法之一
- asp.net中使用fckeditor时,提示“this connector is disabled Please check the"editor/filemanager/connectors/aspx/config.aspx”解决办法
- 解决在头文件加入#include"winsock2.h"后出现重复定义的办法
- fatal error C1083: Cannot open include file: 'htmlhelp.h': No such file or directory 解决办法
- hibernate中实体类构造方法中含有Timestamp 类型变量的"no appropriate constructor.." 错误提示的解决办法