Yii Access Control Lists Class Not Found In Unit Test

Hi

I did this unit test:

class AclTest extends CDbTestCase

{

function testGroup()


{


$rGroup = new RGroup();


$rGroup->alias = "Lavagna";


$rGroup->save();


}

}

but when i do:

phpunit unit/AclTest

i get:

PHP Fatal error: Class ‘RGroup’ not found in C:\wamp\www\visualshopping\protect

ed\tests\unit\AclTest.php on line 28

help please!

The class is just a shortcut to whatever strategy you use - it is generated using runtime. To load the config (and generate this class), you need to call




Strategy::initialize();



before. This can be done in a global controller for instance.

A good place to look is tests/unit/features/* - you can see how things are used there. You might to take a look at BusinessRulesTest.php in the first place because though all of them are advanced examples, this is the easiest one :wink:

Regards,