function RedirectAjaxTest::setUp

Same name in other branches
  1. 10 core/modules/views/tests/src/FunctionalJavascript/RedirectAjaxTest.php \Drupal\Tests\views\FunctionalJavascript\RedirectAjaxTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/views/tests/src/FunctionalJavascript/RedirectAjaxTest.php, line 34

Class

RedirectAjaxTest
Tests that the redirects work with Ajax enabled views.

Namespace

Drupal\Tests\views\FunctionalJavascript

Code

protected function setUp() : void {
    parent::setUp();
    // Enable AJAX on the /admin/content View.
    \Drupal::configFactory()->getEditable('views.view.content')
        ->set('display.default.display_options.use_ajax', TRUE)
        ->save();
    $this->createContentType([
        'type' => 'article',
    ]);
    $this->createNode([
        'title' => 'Tiny paws and playful mews, kittens bring joy in every hue',
        'type' => 'article',
    ]);
    $user = $this->drupalCreateUser([
        'access content overview',
        'administer nodes',
        'bypass node access',
    ]);
    $this->drupalLogin($user);
}

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