You are here

public function SkinrDisplayTestCase::setUp in Skinr 8.2

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides WebTestBase::setUp

File

src/Tests/skinr.test, line 728
Tests for the Skinr module.

Class

SkinrDisplayTestCase
Tests API functionality.

Namespace

Drupal\tracker\Tests

Code

public function setUp() {
  parent::setUp();
  $this->admin_user = $this
    ->drupalCreateUser(array(
    'administer blocks',
    'view the administration theme',
  ));
  $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',
  ));

  // Set admin theme to Garland.
  variable_set('admin_theme', 'garland');
}