You are here

public function ConfigEntityMetadataUpdate8001Test::testConfigEntityMetadataUpdate8001 in Lingotek Translation 8

Tests that field handlers are updated properly.

File

src/Tests/Update/ConfigEntityMetadataUpdate8001Test.php, line 41
Contains \Drupal\lingotek\Tests\Update\ConfigEntityMetadataUpdate8001Test.

Class

ConfigEntityMetadataUpdate8001Test
Tests the upgrade path for config entity metadata.

Namespace

Drupal\lingotek\Tests\Update

Code

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

  // Load the metadata.

  /** @var LingotekConfigMetadata $metadata */
  $metadata = LingotekConfigMetadata::load('node_type.basic_page');

  // Check that values are the right ones.
  $this
    ->assertEqual('8bf008cd-6e36-43a3-a325-e33ae6befe13', $metadata
    ->getDocumentId());
  $this
    ->assertEqual('eb223fc107f7598b96c91e6852f9e58e', $metadata
    ->getHash());
  $source_status = $metadata
    ->getSourceStatus();
  $target_status = $metadata
    ->getTargetStatus();
  $this
    ->assertEqual(Lingotek::STATUS_EDITED, $source_status['en']);
  $this
    ->assertEqual(Lingotek::STATUS_REQUEST, $target_status['es']);
}