Class 'Yii' not found

Hi, again…

I’m trying to do unit test a class, but when I execute mi test, the terminal show me the follows error:

PHP Fatal error: Class ‘Yii’ not found in /var/www/framework/web/widgets/CWidget.php on line 98

I suppose that I need add the class ‘Yii’ to the class CWidget with the command require_once but, I don’t know what file add.

Anyone can help me?

Did you use yiic webapp command to generate your application?

If so, there’s a bootstrap file (protected/tests/bootstrap.php) that loads Yii class (framework/yii.php) , and instantiates CWebApplication. Just always launch phpunit from directory protected/tests or use --bootstrap (or --configuration) option.

If no, you have to write a bootstrap file manually.