function FilterTest::setUp

Same name in this branch
  1. 11.x core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::setUp()
  2. 11.x core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::setUp()
Same name in other branches
  1. 9 core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::setUp()
  2. 9 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FilterTest::setUp()
  3. 9 core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::setUp()
  4. 8.9.x core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::setUp()
  5. 8.9.x core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::setUp()
  6. 10 core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::setUp()
  7. 10 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FilterTest::setUp()
  8. 10 core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php, line 38

Class

FilterTest
Tests the add filter handler UI.

Namespace

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

Code

protected function setUp() : void {
    parent::setUp();
    // 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);
    NodeType::create([
        'type' => 'page',
        'name' => 'Page',
    ])->save();
    FieldConfig::create([
        'entity_type' => 'node',
        'field_name' => 'body',
        'bundle' => 'page',
    ])->save();
}

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