You are here

public function SkinrContextDisplayTestCase::setUp in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 skinr_context/tests/skinr_context.test \SkinrContextDisplayTestCase::setUp()

File

skinr_context/tests/skinr_context.test, line 284
Tests for the Skinr Context module.

Class

SkinrContextDisplayTestCase
Tests API functionality.

Code

public function setUp() {
  parent::setUp(array(
    'block',
    'skinr',
    'skinr_context',
    'skinr_test',
  ));
  $this->admin_user = $this
    ->drupalCreateUser(array(
    'administer blocks',
  ));
  $this
    ->drupalLogin($this->admin_user);

  // Enable main system block for content region and the user menu block for
  // the first sidebar.
  // @see http://drupal.org/node/913086
  $default_theme = variable_get('theme_default', 'bartik');
  db_merge('block')
    ->key(array(
    'theme' => $default_theme,
    'module' => 'system',
    'delta' => 'main',
  ))
    ->fields(array(
    'status' => 1,
    'region' => 'content',
    'pages' => '',
  ))
    ->execute();
  db_merge('block')
    ->key(array(
    'theme' => $default_theme,
    'module' => 'system',
    'delta' => 'user-menu',
  ))
    ->fields(array(
    'status' => 1,
    'region' => 'sidebar_first',
    'pages' => '',
  ))
    ->execute();

  // Enable Garland.
  theme_enable(array(
    'garland',
  ));
}