function EntityDefinitionTestTrait::updateEntityTypeToTranslatable

Same name in this branch
  1. 8.9.x core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php \Drupal\system\Tests\Entity\EntityDefinitionTestTrait::updateEntityTypeToTranslatable()
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::updateEntityTypeToTranslatable()
  2. 10 core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToTranslatable()
  3. 11.x core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToTranslatable()

Updates the 'entity_test_update' entity type to translatable.

Parameters

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

6 calls to EntityDefinitionTestTrait::updateEntityTypeToTranslatable()
ContentTranslationUpdateTest::testContentTranslationUpdate8400 in core/modules/content_translation/tests/src/Functional/Update/ContentTranslationUpdateTest.php
Tests that initial values for metadata fields are populated correctly.
ViewsEntitySchemaSubscriberIntegrationTest::testBrokenView in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests that broken views are handled gracefully.
ViewsEntitySchemaSubscriberIntegrationTest::testDataTableAddition in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests that adding data tables adapts the views.
ViewsEntitySchemaSubscriberIntegrationTest::testDataTableRename in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests that renaming data tables adapts the views.
ViewsEntitySchemaSubscriberIntegrationTest::testVariousTableUpdates in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests a bunch possible entity definition table updates.

... See full list

File

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

Class

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

Namespace

Drupal\Tests\system\Functional\Entity\Traits

Code

protected function updateEntityTypeToTranslatable($perform_update = FALSE) {
    $revisionable = $this->entityDefinitionUpdateManager
        ->getEntityType('entity_test_update')
        ->isRevisionable();
    $updated_entity_type = $this->getUpdatedEntityTypeDefinition($revisionable, TRUE);
    $updated_field_storage_definitions = $this->getUpdatedFieldStorageDefinitions($revisionable, 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.