You are here

protected function EntityDefinitionTestTrait::updateEntityTypeToRevisionable in Zircon Profile 8.0

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

Updates the 'entity_test_update' entity type to revisionable.

11 calls to EntityDefinitionTestTrait::updateEntityTypeToRevisionable()
EntityDefinitionUpdateTest::testEntityTypeSchemaUpdateAndBaseFieldCreateWithoutData in core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
Tests updating entity schema and creating a base field.
EntityDefinitionUpdateTest::testEntityTypeSchemaUpdateAndRevisionableBaseFieldCreateWithoutData in core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
Tests updating entity schema and creating a revisionable base field.
EntityDefinitionUpdateTest::testEntityTypeUpdateWithData in core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
Tests updating entity schema when there are existing entities.
EntityDefinitionUpdateTest::testEntityTypeUpdateWithoutData in core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
Tests updating entity schema when there are no existing entities.
EntityDefinitionUpdateTest::testSingleActionCalls in core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
Tests applying single updates.

... See full list

File

core/modules/system/src/Tests/Entity/EntityDefinitionTestTrait.php, line 39
Contains \Drupal\system\Tests\Entity\EntityDefinitionTestTrait.

Class

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

Namespace

Drupal\system\Tests\Entity

Code

protected function updateEntityTypeToRevisionable() {
  $entity_type = clone $this->entityManager
    ->getDefinition('entity_test_update');
  $keys = $entity_type
    ->getKeys();
  $keys['revision'] = 'revision_id';
  $entity_type
    ->set('entity_keys', $keys);
  $this->state
    ->set('entity_test_update.entity_type', $entity_type);
}