PHPNotice: PleasenolongerincludePHPUnitFramework. php. solution: When you are studying the unit test in Yii Framework, the following error always occurs when you run the "phpunit/DBTest. php" command,
PHP Notice: Please no longer include "PHPUnit/Framework. php". in/usr/share/php/PHPUnit/Framework. php on line 50
However, I installed the PHPUnit package according to the document. later I found that one of the dependency packages had an error during the installation process due to network problems at home, however, all the other packages indicate that the installation is successful. then, you re-install the failed package PHP_CodeCoverage, and the above error occurs when you run the unit, so you slowly find out, after the following steps are performed, the problem is finally solved.
1. open the auto_discover option of pear.
$ Sudo pear config-set auto_discover 12. check the installed phpunit and its dependent packages.
$ Sudo pear list-a Installed packages, channel pear.phpunit.de: ========================================================== === Package Version State DbUnit 1.0.3 stable release 1.2.6 stable PHPUnit 3.5.15 stable release 1.0.9 stable release 1.0.3 stable release 1.0.5 stable PHP_Timer 1.0.2 stable release 1.0.1 stable Text_Template 1.1.0 stable3. uninstall all consumer channels phpunit-related packages, there is a sequence here, and there will be a prompt when uninstalling
$ Sudo pear uninstall PHPUnit $ sudo pear uninstall PHPUnit_MockObject... 4. reinstall the PHPUnit package
$ Sudo pear install pear.phpunit.de/PHPUnit5. run "phpunit unit/DBTest. php" again to solve the problem.