You are here

protected function ContextualFilterTest::setUp in Drupal 10

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

Overrides BrowserTestBase::setUp

File

core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/ContextualFilterTest.php, line 40

Class

ContextualFilterTest
Tests the contextual filter handler UI.

Namespace

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

Code

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

  // Always show advanced column.
  \Drupal::configFactory()
    ->getEditable('views.settings')
    ->set('ui.show.advanced_column', TRUE)
    ->save();

  // Disable automatic live preview to make the sequence of calls clearer. And
  // prevent errors on saving the view with the preview ajax load that are
  // cancelled.
  \Drupal::configFactory()
    ->getEditable('views.settings')
    ->set('ui.always_live_preview', FALSE)
    ->save();
  $account = $this
    ->drupalCreateUser([
    'administer views',
  ]);
  $this
    ->drupalLogin($account);
}