You are here

protected function EntityDefinitionTestTrait::updateEntityTypeToRevisionable in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToRevisionable()
  2. 10 core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToRevisionable()

Updates the 'entity_test_update' entity type to revisionable.

Parameters

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

9 calls to EntityDefinitionTestTrait::updateEntityTypeToRevisionable()
EntityDefinitionUpdateTest::testBundleFieldUpdateWithEntityTypeSchemaUpdate in core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
Tests updating a bundle field when the entity type schema has changed.
EntityDefinitionUpdateTest::testEntityTypeUpdateWithoutData in core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
Tests updating entity schema when there are no existing entities.
EntityDefinitionUpdateTest::testSingleActionCalls in core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
Tests applying single updates.
ViewsEntitySchemaSubscriberIntegrationTest::testDeleteEntityType in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests that views are disabled when an entity type is deleted.
ViewsEntitySchemaSubscriberIntegrationTest::testRevisionBaseTableRename in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests that renaming revision tables adapts the views.

... See full list

File

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

Class

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

Namespace

Drupal\Tests\system\Functional\Entity\Traits

Code

protected function updateEntityTypeToRevisionable($perform_update = FALSE) {
  $translatable = $this->entityDefinitionUpdateManager
    ->getEntityType('entity_test_update')
    ->isTranslatable();
  $updated_entity_type = $this
    ->getUpdatedEntityTypeDefinition(TRUE, $translatable);
  $updated_field_storage_definitions = $this
    ->getUpdatedFieldStorageDefinitions(TRUE, $translatable);
  if ($perform_update) {
    $this->entityDefinitionUpdateManager
      ->updateFieldableEntityType($updated_entity_type, $updated_field_storage_definitions);
  }
}