function EntityDefinitionTestTrait::updateEntityTypeToNotRevisionable

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToNotRevisionable()
  2. 8.9.x core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php \Drupal\system\Tests\Entity\EntityDefinitionTestTrait::updateEntityTypeToNotRevisionable()
  3. 8.9.x core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php \Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait::updateEntityTypeToNotRevisionable()
  4. 11.x 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 157

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);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.