You are here

public function OgVocabUnbindFromContentType::setup in OG Vocabulary 7

File

./og_vocab.test, line 496
Test organic groups vocabulary module.

Class

OgVocabUnbindFromContentType

Code

public function setup() {
  parent::setUp('og_vocab', 'advancedqueue');

  // Create group.
  $group_type = $this
    ->drupalCreateContentType();
  og_create_field(OG_GROUP_FIELD, 'node', $group_type->type);
  $settings = array();
  $settings['type'] = $group_type->type;
  $settings[OG_GROUP_FIELD][LANGUAGE_NONE][0]['value'] = 1;
  $this->group = $this
    ->drupalCreateNode($settings);

  // Create two groups type.
  $type = $this
    ->drupalCreateContentType();
  og_create_field(OG_AUDIENCE_FIELD, 'node', $type->type);
  $this->first_group_content = $this
    ->drupalCreateNode(array(
    'type' => $type->type,
  ));
  $wrapper = entity_metadata_wrapper('node', $this->first_group_content);
  $wrapper->{OG_AUDIENCE_FIELD}
    ->set(array(
    $this->group,
  ));
  $wrapper
    ->save();
  $type = $this
    ->drupalCreateContentType();
  og_create_field(OG_AUDIENCE_FIELD, 'node', $type->type);
  $this->second_group_content = $this
    ->drupalCreateNode(array(
    'type' => $type->type,
  ));
  $wrapper = entity_metadata_wrapper('node', $this->second_group_content);
  $wrapper->{OG_AUDIENCE_FIELD}
    ->set(array(
    $this->group,
  ));
  $wrapper
    ->save();
  variable_set('og_use_queue', TRUE);
}