diff --git a/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php index 60d5c33..01185b5 100644 --- a/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -11,6 +11,7 @@ use Drupal\content_translation\Tests\ContentTranslationUITest; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Url; +use Drupal\node\Entity\Node; /** * Tests the Node Translation UI. @@ -49,6 +50,14 @@ protected function setUp() { } /** + * Tests the basic translation UI. + */ + function testTranslationUI() { + parent::testTranslationUI(); + $this->doUninstallTest(); + } + + /** * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission(). */ protected function getTranslatorPermissions() { @@ -348,4 +357,20 @@ protected function getFormSubmitSuffix(EntityInterface $entity, $langcode) { } return ''; } + + /** + * Tests uninstalling content_translation. + */ + protected function doUninstallTest() { + // Delete all the nodes so there is no data. + $nodes = Node::loadMultiple(); + foreach ($nodes as $node) { + $node->delete(); + } + $language_count = count(\Drupal::configFactory()->listAll('language.content_settings.')); + \Drupal::service('module_installer')->uninstall(['content_translation']); + $this->rebuildContainer(); + $this->assertEqual($language_count, count(\Drupal::configFactory()->listAll('language.content_settings.')), 'Languages have been fixed rather than deleted during content_translation uninstall.'); + } + }