phpunit functional/SiteTest error

When using phpunit example when I run

#phpunit functional/SiteTest.php

I get this error

Fatal error: Class ‘WebTestCase’ not found in /var/www/yiiwp2/app1002/protected/tests/functional/SiteTest.php on line 3

For php5 and Apache 2 I include_path.ini for yii framework like this

My include_path is in /etc/php5/conf.d/include_path.ini

#cd /etc/php5/conf.d/

#nano include_path.ini

include_path = ".:/usr/share/php:/usr/share/php/PEAR:/usr/share/php/PHPUnit:/home/george/knjiznice/yii/framework/"

My bootstrap.php file is

<?php

// change the following paths if necessary

$yiit=dirname(FILE).’/../../../../../../home/george/knjiznice/yii/framework/yiit.php’;

$config=dirname(FILE).’/../config/test.php’;

require_once($yiit);

require_once(dirname(FILE).’/WebTestCase.php’);

Yii::createWebApplication($config);

Can anybody give me a tip? Thanks in advance.

To me it looks like you put bootstrap.php in the protected/tests/functional directory. Try to move it up one level. If needed, adjust the yiit path (config path looks fine to me).

/Tommy

bootstrap.php is one level upper directory like so

george@babylon6:/var/www/yiiwp2/app1002/protected/tests$ ls

bootstrap.php fixtures functional phpunit.xml report unit WebTestCase.php

where functional is directory and in is file SiteTest.php

#nano /var/www/yiiwp2/app1002/protected/tests/functional/SiteTest.php

<?php

class SiteTest extends WebTestCase

{

public function testIndex()


{


	&#036;this-&gt;open('');


	&#036;this-&gt;assertTextPresent('Welcome');


}

Seems like I misinterpreted your first post. It was several months since I used functional tests but scripts similar to yours seems to have no problem finding WebTestCase.php. No more clues at the moment.

Edit: I use phpUnit 3.4.0

/Tommy

I had the same problem with phpunit < 3.4. After upgrading everything went fine.

The docs for the upcoming Yii 1.1.4 release are already fixed:

Yea you have right. I upgrade phpunit package to testing in lenny debian.

from phpunit == 3.2.16.1 to phpunit == 3.4.14-1

and now it works. Thanks guys.

To upgrade a single (phpunit) package in debian lenny:

echo "deb http://ftp.us.debian.org/debian testing main non-free contrib" >> /etc/apt/sources.list

aptitude update

aptitude install phpunit/testing