You are here

protected function StyleSummaryTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php \Drupal\Tests\views\Functional\Plugin\StyleSummaryTest::setUp()

Overrides ViewTestBase::setUp

File

core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php, line 38

Class

StyleSummaryTest
Tests the summary style plugin.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

protected function setUp($import_test_views = TRUE) : void {
  parent::setUp($import_test_views);

  // Create 5 entities per bundle, to allow a summary overview per bundle.
  for ($i = 0; $i < 5; $i++) {
    for ($j = 0; $j < 5; $j++) {
      $this->entities[] = $entity = EntityTest::create([
        'name' => 'Entity ' . ($i * 5 + $j),
        'type' => 'type' . $i,
      ]);
      $entity
        ->save();
    }
  }
  $views_user = $this
    ->drupalCreateUser([
    'administer views',
  ]);
  $this
    ->drupalLogin($views_user);
}