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...