You are here

public function og_menu_singleBase::setUp in OG Menu Single 7

One using of this function is to enable the module used for testing, any dependencies or anything else that might be universal for all tests

Overrides DrupalWebTestCase::setUp

File

tests/og_menu_singleBase.test, line 13
Provides a base unit test class.

Class

og_menu_singleBase
@file Provides a base unit test class.

Code

public function setUp() {
  parent::setUp('og_menu_single', 'og_context');

  // Add OG group field to a the node's "group" bundle.
  $this
    ->drupalCreateContentType(array(
    'type' => 'group',
  ));
  og_create_field(OG_GROUP_FIELD, 'node', 'group');

  // Add OG audience field to the node's "post" bundle.
  $this
    ->drupalCreateContentType(array(
    'type' => 'post',
    'menu_options' => array(
      'main-menu' => TRUE,
      'navigation' => TRUE,
    ),
  ));
  $og_field = og_fields_info(OG_AUDIENCE_FIELD);
  $og_field['instance']['required'] = TRUE;
  og_create_field(OG_AUDIENCE_FIELD, 'node', 'post', $og_field);
  $this
    ->drupalCreateContentType(array(
    'type' => 'post_no_menu',
  ));
  og_create_field(OG_AUDIENCE_FIELD, 'node', 'post_no_menu', $og_field);
}