function ConfigEntityAdapterTest::setUp

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

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php, line 40

Class

ConfigEntityAdapterTest
Tests entity adapter for configuration entities.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUp() : void {
  parent::setUp();
  $this->installConfig(static::$modules);
  // ConfigTest::create doesn't work with the following exception:
  // "Multiple entity types found for Drupal\config_test\Entity\ConfigTest."
  $this->entity = \Drupal::entityTypeManager()->getStorage('config_test')
    ->create([
    'id' => 'system',
    'label' => 'foobar',
    'weight' => 1,
  ]);
}

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