function EntityFieldTest::setUp

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

Overrides EntityKernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php, line 56

Class

EntityFieldTest
Tests the Entity Field API.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUp() {
    parent::setUp();
    foreach (entity_test_entity_types() as $entity_type_id) {
        // The entity_test schema is installed by the parent.
        if ($entity_type_id != 'entity_test') {
            $this->installEntitySchema($entity_type_id);
        }
    }
    // Create the test field.
    module_load_install('entity_test');
    entity_test_install();
    // Install required default configuration for filter module.
    $this->installConfig([
        'system',
        'filter',
    ]);
}

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