You are here

protected function ExposedFilterAJAXTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php \Drupal\Tests\views\FunctionalJavascript\ExposedFilterAJAXTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php, line 32

Class

ExposedFilterAJAXTest
Tests the basic AJAX functionality of Views exposed forms.

Namespace

Drupal\Tests\views\FunctionalJavascript

Code

protected function setUp() {
  parent::setUp();

  // Enable AJAX on the /admin/content View.
  \Drupal::configFactory()
    ->getEditable('views.view.content')
    ->set('display.default.display_options.use_ajax', TRUE)
    ->save();

  // Create a Content type and two test nodes.
  $this
    ->createContentType([
    'type' => 'page',
  ]);
  $this
    ->createNode([
    'title' => 'Page One',
  ]);
  $this
    ->createNode([
    'title' => 'Page Two',
  ]);

  // Create a user privileged enough to use exposed filters and view content.
  $user = $this
    ->drupalCreateUser([
    'administer site configuration',
    'access content',
    'access content overview',
    'edit any page content',
  ]);
  $this
    ->drupalLogin($user);
}