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

Source: Internet
Author: User

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.




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.