PHP notice: Please no longer include "phpunit/framework. php". Solution

Source: Internet
Author: User
Tags channel pear pear

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.