function GlossaryViewTest::setUp

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php \Drupal\Tests\views\FunctionalJavascript\GlossaryViewTest::setUp()
  2. 10 core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php \Drupal\Tests\views\FunctionalJavascript\GlossaryViewTest::setUp()
  3. 11.x core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php \Drupal\Tests\views\FunctionalJavascript\GlossaryViewTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php, line 46

Class

GlossaryViewTest
Tests the basic AJAX functionality of the Glossary View.

Namespace

Drupal\Tests\views\FunctionalJavascript

Code

protected function setUp() : void {
    parent::setUp();
    ViewTestData::createTestViews(static::class, [
        'views_test_config',
    ]);
    // Create a Content type and some test nodes with titles that start with
    // different letters.
    $this->createContentType([
        'type' => 'page',
    ]);
    $titles = [
        'Page One',
        'Page Two',
        'Another page',
    ];
    foreach ($titles as $title) {
        $this->createNode([
            'title' => $title,
            'language' => 'en',
        ]);
        $this->createNode([
            'title' => $title,
            'language' => 'nl',
        ]);
    }
    // Create a user privileged enough to use exposed filters and view content.
    $user = $this->drupalCreateUser([
        'administer site configuration',
        'access content',
        'access content overview',
    ]);
    $this->drupalLogin($user);
}

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