You are here

protected function UITestBase::setUp in Drupal 8

Same name in this branch
  1. 8 core/modules/views_ui/src/Tests/UITestBase.php \Drupal\views_ui\Tests\UITestBase::setUp()
  2. 8 core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::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_ui/src/Tests/UITestBase.php, line 43

Class

UITestBase
Provides a base class for testing the Views UI.

Namespace

Drupal\views_ui\Tests

Code

protected function setUp($import_test_views = TRUE) {
  parent::setUp($import_test_views);
  $this
    ->enableViewsTestModule();
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer views',
  ]);
  $this->fullAdminUser = $this
    ->drupalCreateUser([
    'administer views',
    'administer blocks',
    'bypass node access',
    'access user profiles',
    'view all revisions',
    'administer permissions',
  ]);
  $this
    ->drupalLogin($this->fullAdminUser);
  @trigger_error('\\Drupal\\views_ui\\Tests\\UITestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.x. Instead, use \\Drupal\\Tests\\views_ui\\Functional\\UITestBase', E_USER_DEPRECATED);
}