function BundleDeleteFormTest::setUp

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Entity/BundleDeleteFormTest.php \Drupal\KernelTests\Core\Entity\BundleDeleteFormTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Entity/BundleDeleteFormTest.php, line 42

Class

BundleDeleteFormTest
Tests the bundle deletion form.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUp() : void {
  parent::setUp();
  $this->entityTypeManager = $this->container
    ->get('entity_type.manager');
  $this->installEntitySchema('user');
  $this->installEntitySchema('entity_test_with_bundle');
  $this->entityTypeManager
    ->getStorage('entity_test_bundle')
    ->create([
    'label' => 'Test bundle',
    'id' => 'test',
  ])
    ->save();
  // Create a user who can see the bundle delete form.
  $user = $this->createUser([
    'administer entity_test_bundle content',
    'administer entity_test_with_bundle content',
  ]);
  $this->setCurrentUser($user);
}

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