function EntityViewControllerTest::setUp

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php \Drupal\Tests\system\Functional\Entity\EntityViewControllerTest::setUp()
  2. 8.9.x core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php \Drupal\Tests\system\Functional\Entity\EntityViewControllerTest::setUp()
  3. 11.x core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php \Drupal\Tests\system\Functional\Entity\EntityViewControllerTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php, line 37

Class

EntityViewControllerTest
Tests EntityViewController functionality.

Namespace

Drupal\Tests\system\Functional\Entity

Code

protected function setUp() : void {
    parent::setUp();
    // Create some dummy entity_test entities.
    for ($i = 0; $i < 2; $i++) {
        $entity_test = $this->createTestEntity('entity_test', 'view revision');
        $entity_test->save();
        $this->entities[] = $entity_test;
    }
    $this->drupalLogin($this->drupalCreateUser([
        'view test entity',
    ]));
}

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