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!
Page 1 of 1
Yii Access Control Lists Class Not Found In Unit Test
#2
Posted 25 November 2012 - 04:10 PM
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
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 ;-)
Regards,
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 ;-)
Regards,
Share this topic:
Page 1 of 1

Help











