You are here

public function MoveRevisionMetadataFieldsUpdateTest::testSystemUpdate8501 in Drupal 8

Tests that the revision metadata key BC layer was updated correctly.

@expectedDeprecation The revision_user revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 @expectedDeprecation The revision_created revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 @expectedDeprecation The revision_log_message revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499

File

core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php, line 254

Class

MoveRevisionMetadataFieldsUpdateTest
Tests the upgrade path for moving the revision metadata fields.

Namespace

Drupal\Tests\system\Functional\Entity\Update

Code

public function testSystemUpdate8501() {
  $this
    ->runUpdates();

  /** @var \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface $definition_update_manager */
  $definition_update_manager = $this->container
    ->get('entity.definition_update_manager');
  foreach ([
    'block_content',
    'node',
  ] as $entity_type_id) {
    $installed_entity_type = $definition_update_manager
      ->getEntityType($entity_type_id);
    $revision_metadata_keys = $installed_entity_type
      ->get('revision_metadata_keys');
    $this
      ->assertTrue(isset($revision_metadata_keys['revision_default']));
    $required_revision_metadata_keys = $installed_entity_type
      ->get('requiredRevisionMetadataKeys');
    $this
      ->assertTrue(isset($required_revision_metadata_keys['revision_default']));
  }
}