You are here

public function LingotekProfileEntityIdUpdate8002Test::testConfigEntityMetadataUpdate8001 in Lingotek Translation 8

Tests that the entity definition is loaded correctly.

File

src/Tests/Update/LingotekProfileEntityIdUpdate8002Test.php, line 28

Class

LingotekProfileEntityIdUpdate8002Test
Tests the upgrade path for changing the profile entity id.

Namespace

Drupal\lingotek\Tests\Update

Code

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

  // The lingotek_profile entity exists, but not the profile one.
  $entity_type = \Drupal::entityTypeManager()
    ->getDefinition('profile', FALSE);
  $this
    ->assertNull($entity_type);
  $entity_type = \Drupal::entityTypeManager()
    ->getDefinition('lingotek_profile', FALSE);
  $this
    ->assertNotNull($entity_type
    ->id());

  // Load a profile, it should work.
  $profile = LingotekProfile::load('automatic');
  $this
    ->assertNotNull($profile
    ->id());
}