You are here

public function LdapAuthorizationOg2Tests::createCustomRoles in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_authorization/tests/Og2Tests.test \LdapAuthorizationOg2Tests::createCustomRoles()
1 call to LdapAuthorizationOg2Tests::createCustomRoles()
LdapAuthorizationOg2Tests::testBasicFunctionsAndApi in ldap_authorization/tests/Og2Tests.test
Just make sure install succeeds and.

File

ldap_authorization/tests/Og2Tests.test, line 94

Class

LdapAuthorizationOg2Tests
Simpletest for Ldap Authorization OG Module, for og 7.x-2.x.

Code

public function createCustomRoles() {
  foreach ($this->customOgRoles as $og_role_name => $og_role) {
    $role = new stdClass();
    $role->gid = 0;
    $role->group_type = $og_role['entity_type'];
    $role->group_bundle = $og_role['bundle_type'];
    $role->name = $og_role_name;
    $status = og_role_save($role);
  }
}