You are here

protected function DisplayTest::setUp in Drupal 9

Same name in this branch
  1. 9 core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::setUp()
  2. 9 core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::setUp()
Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::setUp()
  2. 10 core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::setUp()

Overrides ViewTestBase::setUp

File

core/modules/views/tests/src/Functional/Plugin/DisplayTest.php, line 36

Class

DisplayTest
Tests the basic display plugin.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

protected function setUp($import_test_views = TRUE) : void {
  parent::setUp();
  $this
    ->enableViewsTestModule();
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer views',
  ]);
  $this
    ->drupalLogin($this->adminUser);

  // Create 10 nodes.
  for ($i = 0; $i <= 10; $i++) {
    $this
      ->drupalCreateNode([
      'promote' => TRUE,
    ]);
  }
}