You are here

protected function WizardTestBase::setUp in Drupal 8

Same name in this branch
  1. 8 core/modules/views/src/Tests/Wizard/WizardTestBase.php \Drupal\views\Tests\Wizard\WizardTestBase::setUp()
  2. 8 core/modules/views/tests/src/Functional/Wizard/WizardTestBase.php \Drupal\Tests\views\Functional\Wizard\WizardTestBase::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 ViewTestBase::setUp

File

core/modules/views/src/Tests/Wizard/WizardTestBase.php, line 24

Class

WizardTestBase
Views UI wizard tests.

Namespace

Drupal\views\Tests\Wizard

Code

protected function setUp($import_test_views = TRUE) {
  parent::setUp($import_test_views);

  // Create and log in a user with administer views permission.
  $views_admin = $this
    ->drupalCreateUser([
    'administer views',
    'administer blocks',
    'bypass node access',
    'access user profiles',
    'view all revisions',
  ]);
  $this
    ->drupalLogin($views_admin);
  $this
    ->drupalPlaceBlock('local_actions_block');
}