function MapBaseFieldTest::testUninstallMapItemBaseField

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php \Drupal\KernelTests\Core\Field\MapBaseFieldTest::testUninstallMapItemBaseField()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php \Drupal\KernelTests\Core\Field\MapBaseFieldTest::testUninstallMapItemBaseField()
  3. 10 core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php \Drupal\KernelTests\Core\Field\MapBaseFieldTest::testUninstallMapItemBaseField()

Tests uninstalling map item base field.

File

core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php, line 48

Class

MapBaseFieldTest
Tests map base fields.

Namespace

Drupal\KernelTests\Core\Field

Code

public function testUninstallMapItemBaseField() : void {
    $definitions['data_map'] = BaseFieldDefinition::create('map')->setLabel(t('Data'))
        ->setRequired(TRUE);
    $this->state
        ->set('entity_test_update.additional_base_field_definitions', $definitions);
    $this->entityDefinitionUpdateManager
        ->installFieldStorageDefinition('data_map', 'entity_test_update', 'entity_test', $definitions['data_map']);
    $entity = EntityTestUpdate::create([
        'data_map' => [
            'key' => 'value',
        ],
    ]);
    $entity->save();
    $this->entityDefinitionUpdateManager
        ->uninstallFieldStorageDefinition($definitions['data_map']);
}

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