You are here

protected function GlossaryViewTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php \Drupal\Tests\views\FunctionalJavascript\GlossaryViewTest::setUp()
  2. 9 core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php \Drupal\Tests\views\FunctionalJavascript\GlossaryViewTest::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);
}