You are here

protected function EntityViewControllerTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php \Drupal\Tests\system\Functional\Entity\EntityViewControllerTest::setUp()
  2. 9 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 34

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');
    $entity_test
      ->save();
    $this->entities[] = $entity_test;
  }
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'view test entity',
  ]));
}