You are here

protected function GroupedExposedFilterTest::setUp in Drupal 10

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

Overrides BrowserTestBase::setUp

File

core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php, line 50

Class

GroupedExposedFilterTest
Tests the grouped exposed filter admin UI.

Namespace

Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler

Code

protected function setUp() : void {
  parent::setUp();
  ViewTestData::createTestViews(static::class, [
    'views_test_config',
  ]);

  // Disable automatic live preview to make the sequence of calls clearer.
  \Drupal::configFactory()
    ->getEditable('views.settings')
    ->set('ui.always_live_preview', FALSE)
    ->save();
  $this->account = $this
    ->drupalCreateUser([
    'administer views',
  ]);
  $this
    ->drupalLogin($this->account);

  // Setup a node type that has the right fields for the test view.
  NodeType::create([
    'type' => 'page',
  ])
    ->save();
  FieldConfig::create([
    'entity_type' => 'node',
    'field_name' => 'body',
    'bundle' => 'page',
  ])
    ->save();
}