You are here

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

Updates the 'entity_test_update' entity type not revisionable.

Parameters

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

2 calls to EntityDefinitionTestTrait::updateEntityTypeToNotRevisionable()
ViewsEntitySchemaSubscriberIntegrationTest::testRevisionDisabling in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests that removing revision support disables the view.
ViewsEntitySchemaSubscriberIntegrationTest::testVariousTableUpdates in core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
Tests a bunch possible entity definition table updates.

File

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

Class

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

Namespace

Drupal\Tests\system\Functional\Entity\Traits

Code

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