Fatal Error in PHPUnit test


i use windows 7 OS. and i install pear using a CLI

i have added all the necessary path in my windows enviroment variables and

my php.ini file

i installed PHPUnit 3.4.15

and i currently using both yii 1.1.3 and yii-1.1.4

i still have this error when i try to run PHPunit test

i really dont know what to do

thanks in advance.

Have you ensured that both:



Are set correctly in the protected/tests/bootstrap.php file?

I am having the same problem, and yes I have checked the paths in boostrap.php and they are OK.

this is the error in my CLI i receive when i try to run phpunit test for a php file under unit folder

Warning: include(C:\xampp\htdocs\yii

demos\blog\framework\test\CWebTestCase.php): failed to open stream:NO such 

file or directory in C:\xampp\htdocs\yii\framework\YiiBase.php on line 335

thanks in advance :-[

Sorry for my confusion, but your first post outlined an error having to do with not being able to include CTestCase.php and your second seems to be for CWebTestCase.php.

If you don’t mind, can you please provide the exact command you are executing along with the full path to the location from where you are executing it as well as your basic high-level directory structure that outlines where your yii framework files are located with respect to the application from which you are attempting to issue the unit tests?


i think i messed myself up,

from the installation guide for phpunit i didnt install xdebug

secondly i edited the paths when i was first playing around learning yii.

now its working.

thanks to everyone :lol:

My similar problem was because I was not running the latest version of PHPUnit.

What follows may be helpful. Note that I am running Linux.

I tried:

pear install phpunit/PHPUnit

but got an error because the Pear Installer version wasn’t current.

You can force an upgrade of Pear as follows:

pear upgrade --force PEAR

My upgrade of PHPUnit then failed because I did not have the latest version of xdebug.

To upgrade this I used:

apt-get install php5-dev php-pear

pecl install xdebug

Now I could:

pear install phpunit/PHPUnit

and PHPUnit worked.

I have same problem and when run this command:

phpunit -v

I saw following error :

‘pupunit’ is not recognized as an internal or external command, operable program or batch file.

i copy the phpunit.bat in system32 folder( C:\Windows\System32 ) and it work.