function EntityDefinitionTestTrait::updateEntityTypeToRevisionableAndTranslatable

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToRevisionableAndTranslatable()
  2. 8.9.x core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php \Drupal\system\Tests\Entity\EntityDefinitionTestTrait::updateEntityTypeToRevisionableAndTranslatable()
  3. 8.9.x core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToRevisionableAndTranslatable()
  4. 10 core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToRevisionableAndTranslatable()

Updates the test entity type to be revisionable and translatable.

Parameters

bool $perform_update: (optional) Whether the change should be performed by the entity definition update manager.

1 call to EntityDefinitionTestTrait::updateEntityTypeToRevisionableAndTranslatable()
ViewsEntitySchemaSubscriberIntegrationTest::testRevisionDataTableRename in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests that renaming revision tables adapts the views.

File

core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php, line 211

Class

EntityDefinitionTestTrait
Provides some test methods used to update existing entity definitions.

Namespace

Drupal\Tests\system\Functional\Entity\Traits

Code

protected function updateEntityTypeToRevisionableAndTranslatable($perform_update = FALSE) {
    $updated_entity_type = $this->getUpdatedEntityTypeDefinition(TRUE, TRUE);
    $updated_field_storage_definitions = $this->getUpdatedFieldStorageDefinitions(TRUE, TRUE);
    if ($perform_update) {
        $this->entityDefinitionUpdateManager
            ->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.