Another Yii, Xampp, and PHPUnit Problem

I have installed PHPUnit & Selenium as an admin using CMD. I am following along in the book Agile Web Application Development with Yii1.1 and PHP5 and am stuck trying to get phpunit to run a test on the helloWorld app as expected.

I am running Windows 7 with Xampp 1.7.4. I upgraded Pear to version 1.9.4 and installed phpunit 3.6.10 with Selenium 2.2.0.

I run the following as given in the initial unit test example in the book:

%cd protected\tests\

%phpunit functional\SiteTest.php

And am met with the following errors:


d:\xampp\htdocs\testapp\protected\tests>phpunit functional\SiteTest.php

PHP Warning:  include(D:\xampp\yii\yii_root\framework\test\CWebTestCase.php): fa

iled to open stream: No such file or directory in D:\xampp\yii\yii_root\framewor

k\YiiBase.php on line 397


Warning: include(D:\xampp\yii\yii_root\framework\test\CWebTestCase.php): failed

to open stream: No such file or directory in D:\xampp\yii\yii_root\framework\Yii

Base.php on line 397

PHP Warning:  include(): Failed opening 'D:\xampp\yii\yii_root\framework\test\CW

ebTestCase.php' for inclusion (include_path='.<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/grin.gif' class='bbc_emoticon' alt=';D' />:\xampp\php\PEAR') in D:\xampp\y

ii\yii_root\framework\YiiBase.php on line 397


Warning: include(): Failed opening 'D:\xampp\yii\yii_root\framework\test\CWebTes

tCase.php' for inclusion (include_path='.<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/grin.gif' class='bbc_emoticon' alt=';D' />:\xampp\php\PEAR') in D:\xampp\yii\yi

i_root\framework\YiiBase.php on line 397

PHP Fatal error:  Class 'CWebTestCase' not found in D:\xampp\htdocs\testapp\prot

ected\tests\WebTestCase.php on line 15


Fatal error: Class 'CWebTestCase' not found in D:\xampp\htdocs\testapp\protected

\tests\WebTestCase.php on line 15

I’m not sure how to fix this and have been scouring the forums for a hint, but can’t for the life of me figure this out.

I’ve been struggling with this for the past 5 hours – so any help in solving this would be greatly appreciated!!

Seems that you have not setup your directory structure correctly.

What is the path to your framework installation of yii?

Framework is installed in D:\xampp\yii\yii_root\

Test app was created using %yiic webapp D:\xampp\htdocs\testapp and runs just fine off localhost.

[Edited]: Solved (though I feel like a fool). It turns out for some reason root install of Yii did not include a test folder. I simply re-downloaded the framework and re-installed. Works like a charm now.

Can you c&p your bootstrap.php content?

it should be located "D:\xampp\htdocs\testapp\protected\test\" folder

Great to hear, good luck with your yii adventures ;)

Excited to keep going with Yii! Thank you for your help.