You are here

public function SpacesDashboardTestCase::setUp in Spaces 7.3

Same name and namespace in other branches
  1. 6.3 spaces_dashboard/tests/spaces_dashboard.test \SpacesDashboardTestCase::setUp()
  2. 7 spaces_dashboard/tests/spaces_dashboard.test \SpacesDashboardTestCase::setUp()

Set up test.

Overrides DrupalWebTestCase::setUp

File

spaces_dashboard/tests/spaces_dashboard.test, line 18

Class

SpacesDashboardTestCase

Code

public function setUp() {
  parent::setUp('context', 'context_ui', 'ctools', 'features', 'spaces', 'spaces_dashboard');

  // Use context to ensure the Dashboard editor block is visible for our tests.
  ctools_include('export');
  $context = ctools_export_new_object('context');
  $context->name = 'testcontext';
  $context->conditions = array(
    'sitewide' => array(
      'values' => array(
        1,
      ),
    ),
  );
  $context->reactions = array(
    'block' => array(
      'blocks' => array(
        'spaces_dashboard-editor' => array(
          'module' => 'spaces_dashboard',
          'delta' => 'editor',
          'region' => 'sidebar_second',
          'weight' => 0,
        ),
      ),
    ),
  );
  $saved = context_save($context);
  $this
    ->assertTrue($saved, "Context 'testcontext' saved.");
  $admin_user = $this
    ->drupalCreateUser(array(
    'administer site configuration',
    'administer dashboards',
  ));
  $this
    ->drupalLogin($admin_user);
}