diff --git a/core/modules/content_translation/src/Tests/ContentTranslationEnableTest.php b/core/modules/content_translation/src/Tests/ContentTranslationEnableTest.php new file mode 100644 index 0000000..47c7669 --- /dev/null +++ b/core/modules/content_translation/src/Tests/ContentTranslationEnableTest.php @@ -0,0 +1,51 @@ +installEntitySchema('entity_test_mul'); + \Drupal::entityDefinitionUpdateManager()->applyUpdates(); + } + + /** + * Tests that entity schemas are up-to-date after enabling translation. + */ + public function testEnable() { + // No pending updates should be available. + $this->assertTrue(empty(\Drupal::entityDefinitionUpdateManager()->getChangeSummary())); + + $this->enableModules(['content_translation', 'language']); + + // Enable translation on a new entity type. + \Drupal::service('content_translation.manager')->setEnabled('entity_test_mul', 'foo', TRUE); + drupal_static_reset(); + \Drupal::entityManager()->clearCachedDefinitions(); + + // No pending updates should be available. + $this->assertTrue(empty(\Drupal::entityDefinitionUpdateManager()->getChangeSummary())); + } + +}