You are here

protected function EntityDefinitionTestTrait::updateEntityTypeToNotTranslatable 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::updateEntityTypeToNotTranslatable()
  2. 10 core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToNotTranslatable()

Updates the 'entity_test_update' entity type to not translatable.

Parameters

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

2 calls to EntityDefinitionTestTrait::updateEntityTypeToNotTranslatable()
ViewsEntitySchemaSubscriberIntegrationTest::testVariousTableUpdates in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests a bunch possible entity definition table updates.
ViewsEntitySchemaSubscriberIntegrationTest::testVariousTableUpdatesForRevisionView in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests some possible entity table updates for a revision view.

File

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

Class

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

Namespace

Drupal\Tests\system\Functional\Entity\Traits

Code

protected function updateEntityTypeToNotTranslatable($perform_update = FALSE) {
  $revisionable = $this->entityDefinitionUpdateManager
    ->getEntityType('entity_test_update')
    ->isRevisionable();
  $updated_entity_type = $this
    ->getUpdatedEntityTypeDefinition($revisionable, FALSE);
  $updated_field_storage_definitions = $this
    ->getUpdatedFieldStorageDefinitions($revisionable, FALSE);
  if ($perform_update) {
    $this->entityDefinitionUpdateManager
      ->updateFieldableEntityType($updated_entity_type, $updated_field_storage_definitions);
  }
}