You are here

public function SpacesOGTestCase::setUp in Spaces 6.3

Same name and namespace in other branches
  1. 7.3 spaces_og/tests/spaces_og.test \SpacesOGTestCase::setUp()
  2. 7 spaces_og/tests/spaces_og.test \SpacesOGTestCase::setUp()

Set up test.

Overrides DrupalWebTestCase::setUp

1 call to SpacesOGTestCase::setUp()
SpacesOGTestAutocomplete::setUp in spaces_og/tests/spaces_og.test
Set up test.
1 method overrides SpacesOGTestCase::setUp()
SpacesOGTestAutocomplete::setUp in spaces_og/tests/spaces_og.test
Set up test.

File

spaces_og/tests/spaces_og.test, line 15

Class

SpacesOGTestCase
Base test class for Spaces OG tests.

Code

public function setUp() {

  // Not enabling views leads to notices if views is present in search path :P
  parent::setUp('context', 'ctools', 'strongarm', 'views', 'features', 'features_test', 'og', 'og_access', 'og_views', 'purl', 'spaces', 'spaces_ui', 'spaces_og', 'spaces_test', 'taxonomy');

  // Log in admin user.
  $this
    ->loginAdminUser();

  // Rebuild node access table otherwise ACL's won't work.
  $this
    ->drupalPost('admin/content/node-settings/rebuild', array(), 'Rebuild permissions');

  // Pick a default for group spaces (part of the install process).
  $edit = array(
    'spaces_preset_og' => 'og_public',
  );
  $this
    ->drupalPost('admin/build/spaces', $edit, 'Save configuration');

  // Configure organic groups space and set up an organic group.
  $edit = array(
    'name' => 'Group',
    'type' => 'group',
    'og_content_type_usage' => 'group',
  );
  $this
    ->drupalPost('admin/content/types/add', $edit, 'Save content type');
  $this
    ->assertText('The content type Group has been added.');
  $edit = array(
    'title' => 'Group A',
    'og_description' => 'Group A.',
    'purl[value]' => 'group-a',
  );
  $this
    ->drupalPost('node/add/group', $edit, 'Save');
  $this
    ->assertText('Group Group A has been created.');

  // Test whether first-time save actually works.
  $this
    ->assertEqual('og_public', unserialize(db_result(db_query('SELECT value from {spaces_overrides} WHERE id = 1'))));
}