function StyleSummaryTest::setUp

Same name in other branches
  1. 9 core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php \Drupal\Tests\views\Functional\Plugin\StyleSummaryTest::setUp()
  2. 8.9.x core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php \Drupal\Tests\views\Functional\Plugin\StyleSummaryTest::setUp()
  3. 11.x 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 40

Class

StyleSummaryTest
Tests the summary style plugin.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

protected function setUp($import_test_views = TRUE, $modules = [
    'views_test_config',
]) : void {
    parent::setUp($import_test_views, $modules);
    // 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);
}

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