diff --git a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php b/core/modules/language/src/Tests/LanguageConfigurationElementTest.php index c98ef25..8f3528c 100644 --- a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php +++ b/core/modules/language/src/Tests/LanguageConfigurationElementTest.php @@ -164,6 +164,41 @@ public function testNodeTypeUpdate() { } /** + * Tests the language setting are deleted on bundle delete. + */ + public function testNodeTypeDelete() { + // Create the article content type first if the profile used is not the + // standard one. + if ($this->profile != 'standard') { + $this->drupalCreateContentType(array( + 'type' => 'article', + 'name' => 'Article' + )); + } + $admin_user = $this->drupalCreateUser(array('administer content types')); + $this->drupalLogin($admin_user); + + // Create are language configuration for the articles. + $edit = array( + 'language_configuration[langcode]' => 'authors_default', + 'language_configuration[language_alterable]' => TRUE, + ); + $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type')); + + // Check the language default configuration for the articles is present. + $configuration = \Drupal::entityManager()->getStorage('language_content_settings')->load('node.article'); + $this->assertTrue($configuration, 'The language configuration is present.'); + + // Delete the articles bundle. + $this->drupalPostForm('admin/structure/types/manage/article/delete', array(), t('Delete')); + + // Check that the language configuration have been deleted. + \Drupal::entityManager()->getStorage('language_content_settings')->resetCache(); + $configuration = \Drupal::entityManager()->getStorage('language_content_settings')->load('node.article'); + $this->assertFalse($configuration, 'The language configuration were deleted after bundle were deleted.'); + } + + /** * Tests that the configuration is updated when a vocabulary is changed. */ public function testTaxonomyVocabularyUpdate() {