You are here

protected function ThemeTest::setUp in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/taxonomy/src/Tests/ThemeTest.php \Drupal\taxonomy\Tests\ThemeTest::setUp()
  2. 8 core/modules/system/src/Tests/System/ThemeTest.php \Drupal\system\Tests\System\ThemeTest::setUp()
  3. 8 core/modules/system/src/Tests/Theme/ThemeTest.php \Drupal\system\Tests\Theme\ThemeTest::setUp()
Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/Tests/ThemeTest.php \Drupal\taxonomy\Tests\ThemeTest::setUp()

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 TaxonomyTestBase::setUp

File

core/modules/taxonomy/src/Tests/ThemeTest.php, line 17
Contains \Drupal\taxonomy\Tests\ThemeTest.

Class

ThemeTest
Verifies that various taxonomy pages use the expected theme.

Namespace

Drupal\taxonomy\Tests

Code

protected function setUp() {
  parent::setUp();

  // Make sure we are using distinct default and administrative themes for
  // the duration of these tests.
  \Drupal::service('theme_handler')
    ->install(array(
    'bartik',
    'seven',
  ));
  $this
    ->config('system.theme')
    ->set('default', 'bartik')
    ->set('admin', 'seven')
    ->save();

  // Create and log in as a user who has permission to add and edit taxonomy
  // terms and view the administrative theme.
  $admin_user = $this
    ->drupalCreateUser(array(
    'administer taxonomy',
    'view the administration theme',
  ));
  $this
    ->drupalLogin($admin_user);
}