When I was studying unit testing in yii framework today, the following error always occurred while running the "phpunit unit/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 <br/> installed packages, channel pear.phpunit.de: <br/> ========================================== =======< br/> package version state <br/> dbunit 1.0.3 stable <br/> file_iterator 1.2.6 stable <br/> phpunit 3.5.15 stable <br/> phpunit_mockobject 1.0.9 stable <br/> fixed 1.0.3 stable <br/> php_codecoverage 1.0.5 stable <br/> php_timer 1.0.2 stable <br/> php_tokenstream 1.0.1 stable <br/> text_template 1.1.0 stable3. Uninstall all phpunit-related packages installed in pear.phpunit.de channel. The sequence is displayed.
$ Sudo pear uninstall phpunit <br/> $ sudo pear uninstall phpunit_mockobject <br/>...4. reinstall the phpunit package
$ Sudo pear install pear.phpunit.de/phpunit5. Run "phpunit/dbtest. php" again to solve the problem.