function ClickSortingAJAXTest::setUp

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

Overrides BrowserTestBase::setUp

File

core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php, line 37

Class

ClickSortingAJAXTest
Tests the click sorting AJAX functionality of Views exposed forms.

Namespace

Drupal\Tests\views\FunctionalJavascript

Code

protected function setUp() : void {
    parent::setUp();
    ViewTestData::createTestViews(self::class, [
        'views_test_config',
    ]);
    // Create a Content type and two test nodes.
    $this->createContentType([
        'type' => 'page',
    ]);
    $this->createNode([
        'title' => 'Page A',
        'changed' => \Drupal::time()->getRequestTime(),
    ]);
    $this->createNode([
        'title' => 'Page B',
        'changed' => \Drupal::time()->getRequestTime() + 1000,
    ]);
    // Create a user privileged enough to 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.