PHPNotice: Pleasenolongerinclude solution _ PHP Tutorial

Source: Internet
Author: User
Tags channel pear
PHPNotice: Pleasenolongerinclude solution. PhpunitunitDBTest is always running during the unit test in YiiFramework. PHPNotice: pleasenolonger=dephpunitframework. p is always running "phpunit/DBTest. the following error occurs during the 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.

View plaincopy to clipboardprint? $ Sudo pear config-set auto_discover 1
$ Sudo pear config-set auto_discover 12. check the installed phpunit and its dependent packages.

View plaincopy to clipboardprint? $ Sudo pear list-
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
PHP_CodeCoverage 1.0.5 stable
PHP_Timer 1.0.2 stable
PHP_TokenStream 1.0.1 stable
Text_Template 1.1.0 stable
$ Sudo pear list-
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
PHP_CodeCoverage 1.0.5 stable
PHP_Timer 1.0.2 stable
PHP_TokenStream 1.0.1 stable
Text_Template 1.1.0 stable3. uninstall all phpunit-related packages installed in the pear.phpunit.de channel. the sequence is displayed.

View plaincopy to clipboardprint? $ Sudo pear uninstall PHPUnit
$ Sudo pear uninstall PHPUnit_MockObject
...
$ Sudo pear uninstall PHPUnit
$ Sudo pear uninstall PHPUnit_MockObject
... 4. reinstall the PHPUnit package

View plaincopy to clipboardprint? $ Sudo pear install pear.phpunit.de/PHPUnit
$ Sudo pear install pear.phpunit.de/PHPUnit5. run "phpunit unit/DBTest. php" again to solve the problem.

The author's "kongxx column"

The following error occurs when you run the phpunit unit/DBTest. php command during unit Testing in protocol Framework. PHP Notice: Please no longer include PHPUnit/Framework. p...

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.