function EntitySchemaTest::updateEntityType

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

Updates the entity type definition.

Parameters

bool $alter: Whether the original definition should be altered or not.

2 calls to EntitySchemaTest::updateEntityType()
EntitySchemaTest::testEntitySchemaUpdate in core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
Tests that entity schema responds to changes in the entity type definition.
EntitySchemaTest::testModifyingTranslatableColumnSchema in core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
Tests that modifying the UUID field for a translatable entity works.

File

core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php, line 77

Class

EntitySchemaTest
Tests the default entity storage schema handler.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function updateEntityType($alter) {
    $this->state
        ->set('entity_schema_update', $alter);
    $updated_entity_type = $this->getUpdatedEntityTypeDefinition($alter, $alter);
    $updated_field_storage_definitions = $this->getUpdatedFieldStorageDefinitions($alter, $alter);
    $this->container
        ->get('entity.definition_update_manager')
        ->updateFieldableEntityType($updated_entity_type, $updated_field_storage_definitions);
}

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