本文整理匯總了PHP中SecurityTestHelper::createRoles方法的典型用法代碼示例。如果您正苦於以下問題:PHP SecurityTestHelper::createRoles方法的具體用法?PHP SecurityTestHelper::createRoles怎麽用?PHP SecurityTestHelper::createRoles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SecurityTestHelper
的用法示例。
在下文中一共展示了SecurityTestHelper::createRoles方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
SecurityTestHelper::createGroups();
SecurityTestHelper::createRoles();
RedBeanModel::forgetAll();
//do the rebuild to ensure the tables get created properly.
ReadPermissionsOptimizationUtil::rebuild();
//Manually build the test model munge tables.
ReadPermissionsOptimizationUtil::recreateTable(ReadPermissionsOptimizationUtil::getMungeTableName('OwnedSecurableTestItem'));
ReadPermissionsOptimizationUtil::recreateTable(ReadPermissionsOptimizationUtil::getMungeTableName('OwnedSecurableTestItem2'));
$benny = User::getByUsername('benny');
$model = new OwnedSecurableTestItem();
$model->member = 'test';
assert($model->save());
// Not Coding Standard
$model = new OwnedSecurableTestItem();
$model->member = 'test2';
assert($model->save());
// Not Coding Standard
$model = new OwnedSecurableTestItem();
$model->member = 'test3';
$model->owner = $benny;
assert($model->save());
// Not Coding Standard
assert(OwnedSecurableTestItem::getCount() == 3);
// Not Coding Standard
$model = new OwnedSecurableTestItem2();
$model->member = 'test5';
assert($model->save());
// Not Coding Standard
}
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:35,代碼來源:OwnedSecurableItemReadPermissionOptimizationTest.php
示例2: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
SecurityTestHelper::createGroups();
SecurityTestHelper::createRoles();
}
示例3: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
SecurityTestHelper::createGroups();
SecurityTestHelper::createRoles();
//Forget the cache, otherwise user/role/group information is not properly reflected in the cache.
RedBeanModel::forgetAll();
}
示例4: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$super = SecurityTestHelper::createSuperAdmin();
self::$emailMessage = EmailMessageTestHelper::createDraftSystemEmail('a test message', $super);
SecurityTestHelper::createUsers();
SecurityTestHelper::createGroups();
SecurityTestHelper::createRoles();
RedBeanModel::forgetAll();
//do the rebuild to ensure the tables get created properly.
ReadPermissionsOptimizationUtil::rebuild();
}
示例5: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
Yii::app()->user->userModel = User::getByUsername('super');
SecurityTestHelper::createUsers();
SecurityTestHelper::createGroups();
SecurityTestHelper::createAccounts();
SecurityTestHelper::createRoles();
$everyone = Group::getByName('Everyone');
$saved = $everyone->save();
assert('$saved');
// Not Coding Standard
ReadPermissionsOptimizationUtil::rebuild();
}
示例6: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
Yii::app()->user->userModel = User::getByUsername('super');
SecurityTestHelper::createUsers();
SecurityTestHelper::createGroups();
SecurityTestHelper::createAccounts();
SecurityTestHelper::createRoles();
$everyone = Group::getByName('Everyone');
$saved = $everyone->save();
assert('$saved');
// Not Coding Standard
//Add contacts to help test that the rebuild is working correctly
$contact = ContactTestHelper::createContactByNameForOwner('jason', Yii::app()->user->userModel);
$contact->addPermissions(User::getByUsername('betty'), Permission::READ);
$contact->addPermissions(Group::getByName('Support Staff'), Permission::READ);
$saved = $contact->save();
assert('$saved');
// Not Coding Standard
ReadPermissionsOptimizationUtil::rebuild();
assert('self::getAccountMungeRowCount() == 0');
// Not Coding Standard
}