Today, when you are learning unit tests in the YII framework, the following error always occurs when you run 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
But it is according to the document that the installation of the PHPUnit package Ah, later found that the installation process due to the home network problem one of the dependencies of the package error, but other packages are prompted to install successfully, and then they are the failure of the package php_codecoverage reinstall, Then run the unit when the above error occurred, so they slowly groping, and then did the following steps, the problem was finally solved.
1. Open Pear's auto_discover option
$ sudo pear config-set auto_discover 1
2. Check the installed PHPUnit and its dependency pack
$ 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 1.0.5 Stable
php_timer 1.0.2 stable
php_tokenstream 1.0.1 Stable Text_ Template 1.1.0 Stable
3. Uninstall all pear.phpunit.de Channel installed and phpunit-related packages, here is the order, the uninstall will be prompted
$ sudo pear uninstall PHPUnit
$ sudo pear uninstall phpunit_mockobject
...
4. Reinstall the PHPUNIT Package
$ sudo pear install Pear.phpunit.de/phpunit
5. Run "PHPUnit unit/dbtest.php again" and solve the problem.