function ConfigEntityAdapterTest::setUp

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php \Drupal\KernelTests\Core\Entity\ConfigEntityAdapterTest::setUp()
  2. 10 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 38

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.