function LdapAuthorizationOg2Tests::brokensetUp in Lightweight Directory Access Protocol (LDAP) 7
File
- ldap_authorization/
tests/ Og/ Og2.test, line 37
Class
Code
function brokensetUp($addl_modules = array()) {
parent::setUp(array(
'ldap_authorization_og',
'og_example',
));
if (ldap_authorization_og_og_version() != 2) {
debug('LdapAuthorizationOg2Tests must be run with OG 7.x-2.x');
return;
}
// TODO: Fix failing tests, excluding to make branch pass.
return;
$this->user1 = $this
->drupalCreateUser();
$this->groups = array();
require 'ldap_authorization_og2.inc';
foreach ($og_roles 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);
}
// Create group and group content node types.
$this->group_type = $this
->drupalCreateContentType()->type;
og_create_field(OG_GROUP_FIELD, 'node', $this->group_type);
$this->group_content_type = $this
->drupalCreateContentType()->type;
og_create_field(OG_AUDIENCE_FIELD, 'node', $this->group_content_type);
foreach ($og_groups as $og_name => $og_conf) {
$label = $og_conf['label'];
if ($og_conf['entity_type'] == 'node') {
$settings = array();
$settings['type'] = $this->group_type;
$settings[OG_GROUP_FIELD][LANGUAGE_NONE][0]['value'] = 1;
$settings['uid'] = $this->user1->uid;
$settings['title'] = $og_conf['label'];
$settings['type'] = $og_conf['bundle'];
$this->group_nodes[$og_name] = $this
->drupalCreateNode($settings);
}
}
}