function ContextualFiltersStringTest::setUp

Same name in other branches
  1. 9 core/modules/views/tests/src/Functional/Plugin/ContextualFiltersStringTest.php \Drupal\Tests\views\Functional\Plugin\ContextualFiltersStringTest::setUp()
  2. 10 core/modules/views/tests/src/Functional/Plugin/ContextualFiltersStringTest.php \Drupal\Tests\views\Functional\Plugin\ContextualFiltersStringTest::setUp()

Overrides ViewTestBase::setUp

File

core/modules/views/tests/src/Functional/Plugin/ContextualFiltersStringTest.php, line 53

Class

ContextualFiltersStringTest
Test contextual filters with 'allow multiple values' setting for user roles.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

protected function setUp($import_test_views = TRUE, $modules = [
    'views_test_config',
]) : void {
    parent::setUp($import_test_views, $modules);
    // Create Roles and users.
    $this->role1 = $this->drupalCreateRole([
        'access content',
    ], 'editor', 'Editor');
    $this->role2 = $this->drupalCreateRole([
        'access content',
    ], 'publisher', 'Publisher');
    $this->createUser([], 'user1', FALSE, [
        'roles' => [
            $this->role1,
        ],
    ]);
    $this->createUser([], 'user2', FALSE, [
        'roles' => [
            $this->role2,
        ],
    ]);
    $this->createUser([], 'user3', FALSE, [
        'roles' => [
            $this->role1,
            $this->role2,
        ],
    ]);
    $this->createUser([], 'user4', FALSE, [
        'roles' => [
            $this->role2,
        ],
    ]);
    $this->createUser([], 'user5', FALSE, [
        'roles' => [
            $this->role1,
            $this->role2,
        ],
    ]);
    $this->drupalLogin($this->createUser([
        'administer views',
    ]));
}

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