function AccessTest::setUp

Same name in this branch
  1. 8.9.x core/modules/file/tests/src/Kernel/AccessTest.php \Drupal\Tests\file\Kernel\AccessTest::setUp()
Same name in other branches
  1. 9 core/modules/file/tests/src/Kernel/AccessTest.php \Drupal\Tests\file\Kernel\AccessTest::setUp()
  2. 9 core/modules/views/tests/src/Functional/Plugin/AccessTest.php \Drupal\Tests\views\Functional\Plugin\AccessTest::setUp()
  3. 10 core/modules/file/tests/src/Kernel/AccessTest.php \Drupal\Tests\file\Kernel\AccessTest::setUp()
  4. 10 core/modules/views/tests/src/Functional/Plugin/AccessTest.php \Drupal\Tests\views\Functional\Plugin\AccessTest::setUp()
  5. 11.x core/modules/file/tests/src/Kernel/AccessTest.php \Drupal\Tests\file\Kernel\AccessTest::setUp()
  6. 11.x core/modules/views/tests/src/Functional/Plugin/AccessTest.php \Drupal\Tests\views\Functional\Plugin\AccessTest::setUp()

Overrides ViewTestBase::setUp

File

core/modules/views/tests/src/Functional/Plugin/AccessTest.php, line 51

Class

AccessTest
Tests pluggable access for views.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

protected function setUp($import_test_views = TRUE) {
    parent::setUp($import_test_views);
    $this->enableViewsTestModule();
    ViewTestData::createTestViews(get_class($this), [
        'views_test_data',
    ]);
    $this->webUser = $this->drupalCreateUser();
    $normal_role = $this->drupalCreateRole([]);
    $this->normalUser = $this->drupalCreateUser([
        'views_test_data test permission',
    ]);
    $this->normalUser
        ->addRole($normal_role);
    // @todo when all the plugin information is cached make a reset function and
    // call it here.
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.