diff --git a/core/modules/aggregator/src/Tests/FeedLanguageTest.php b/core/modules/aggregator/src/Tests/FeedLanguageTest.php index a5ce7a2..09c608c 100644 --- a/core/modules/aggregator/src/Tests/FeedLanguageTest.php +++ b/core/modules/aggregator/src/Tests/FeedLanguageTest.php @@ -43,8 +43,6 @@ protected function setUp() { $language->save(); $this->langcodes[$i] = $language->id(); } - - language_save_default_configuration('aggregator_feed', 'aggregator_feed', array('langcode' => 'site_default', 'language_show' => TRUE)); } /** @@ -54,8 +52,8 @@ public function testFeedLanguage() { /** @var \Drupal\aggregator\FeedInterface[] $feeds */ $feeds = array(); // Create feeds. - $feeds[1] = $this->createFeed(NULL, array('langcode[0][value]' => $this->langcodes[1])); - $feeds[2] = $this->createFeed(NULL, array('langcode[0][value]' => $this->langcodes[2])); + $feeds[1] = $this->createFeed(NULL, array('langcode' => $this->langcodes[1])); + $feeds[2] = $this->createFeed(NULL, array('langcode' => $this->langcodes[2])); // Make sure that the language has been assigned. $this->assertEqual($feeds[1]->language()->getId(), $this->langcodes[1]); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php index 981c3ed..e52036b 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php @@ -163,7 +163,6 @@ protected function setupBundle() { protected function enableTranslation() { // Enable translation for the current entity type and ensure the change is // picked up. - language_save_default_configuration($this->entityTypeId, $this->bundle, array('langcode' => 'site_default', 'language_show' => TRUE)); content_translation_set_config($this->entityTypeId, $this->bundle, 'enabled', TRUE); drupal_static_reset(); \Drupal::entityManager()->clearCachedDefinitions(); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationUITest.php b/core/modules/content_translation/src/Tests/ContentTranslationUITest.php index d9c695d..5e8497b 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationUITest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationUITest.php @@ -8,6 +8,7 @@ namespace Drupal\content_translation\Tests; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface; diff --git a/core/modules/locale/src/Tests/LocaleContentTest.php b/core/modules/locale/src/Tests/LocaleContentTest.php index 1bef062..f9f43f0 100644 --- a/core/modules/locale/src/Tests/LocaleContentTest.php +++ b/core/modules/locale/src/Tests/LocaleContentTest.php @@ -95,12 +95,12 @@ public function testContentTypeLanguageConfiguration() { $this->drupalLogin($web_user); $this->drupalGet("node/add/{$type1->type}"); // Verify language select list is not present. - $this->assertNoFieldByName('language', NULL, 'Language select not present on the node add form.'); + $this->assertNoFieldByName('langcode[0][value]', NULL, 'Language select not present on the node add form.'); // Verify language selection appears on the node add form. $this->drupalGet("node/add/{$type2->type}"); // Verify language select list is present. - $this->assertFieldByName('langcode', NULL, 'Language select present on the node add form.'); + $this->assertFieldByName('langcode[0][value]', NULL, 'Language select present on the node add form.'); // Ensure language appears. $this->assertText($name, 'Language present.'); @@ -120,7 +120,7 @@ public function testContentTypeLanguageConfiguration() { $this->assertRaw('', 'Correct language selected.'); // Ensure we can change the node language. $edit = array( - 'langcode' => 'en', + 'langcode[0][value]' => 'en', ); $this->drupalPostForm($path, $edit, t('Save')); $this->assertRaw(t('%title has been updated.', array('%title' => $node_title))); diff --git a/core/modules/menu_ui/src/Tests/MenuLanguageTest.php b/core/modules/menu_ui/src/Tests/MenuLanguageTest.php index f74fb09..0664b81 100644 --- a/core/modules/menu_ui/src/Tests/MenuLanguageTest.php +++ b/core/modules/menu_ui/src/Tests/MenuLanguageTest.php @@ -105,7 +105,7 @@ function testMenuLanguage() { // Now change the language of the new link to 'bb'. $edit = array( - 'langcode' => 'bb', + 'langcode[0][value]' => 'bb', ); $this->drupalPostForm('admin/structure/menu/item/' . $menu_link->id() . '/edit', $edit, t('Save')); $this->assertMenuLink($menu_link->getPluginId(), array( @@ -119,14 +119,14 @@ function testMenuLanguage() { // page first. $this->drupalGet('admin/structure/menu/item/' . $menu_link->id() . '/edit'); // Check that the language selector has the correct default value. - $this->assertOptionSelected('edit-langcode', 'bb', 'The menu link language was correctly selected.'); + $this->assertOptionSelected('edit-langcode-0-value', 'bb', 'The menu link language was correctly selected.'); // Edit menu to hide the language select on menu link item add. language_save_default_configuration('menu_link_content', 'menu_link_content', array('langcode' => 'cc', 'language_show' => FALSE)); // Check that the language selector is not available on menu link add page. $this->drupalGet("admin/structure/menu/manage/$menu_name/add"); - $this->assertNoField('edit-langcode', 'The language selector field was hidden the page'); + $this->assertNoField('edit-langcode-0-value', 'The language selector field was hidden the page'); } /** diff --git a/core/modules/node/src/Tests/NodeFieldMultilingualTest.php b/core/modules/node/src/Tests/NodeFieldMultilingualTest.php index d00ffcd..1e2c731 100644 --- a/core/modules/node/src/Tests/NodeFieldMultilingualTest.php +++ b/core/modules/node/src/Tests/NodeFieldMultilingualTest.php @@ -84,7 +84,7 @@ function testMultilingualNodeForm() { $this->drupalGet("node/{$node->id()}/edit"); $edit = array( $title_key => $this->randomMachineName(8), - 'langcode' => $langcode, + 'langcode[0][value]' => $langcode, ); $this->drupalPostForm(NULL, $edit, t('Save')); $node = $this->drupalGetNodeByTitle($edit[$title_key], TRUE); diff --git a/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php index 59da34d..b3e3351 100644 --- a/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php +++ b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php @@ -89,7 +89,7 @@ function testEntityFormLanguage() { $langcode = $this->langcodes[0]; $edit['title[0][value]'] = $this->randomMachineName(8); $edit['body[0][value]'] = $this->randomMachineName(16); - $edit['langcode'] = $langcode; + $edit['langcode[0][value]'] = $langcode; $this->drupalPostForm('node/add/page', $edit, t('Save')); $this->assertRaw(t('Basic page %title has been created.', array('%title' => $edit['title[0][value]'])), 'Basic page created.'); diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php index 89b5f6e..c583c46 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php @@ -76,12 +76,8 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setReadOnly(TRUE); $fields['langcode'] = BaseFieldDefinition::create('language') - ->setLabel(t('Language')) - ->setDescription(t('The language code of the test entity.')) - ->setDisplayOptions('form', array( - 'type' => 'language_select', - 'weight' => 2, - )); + ->setLabel(t('Language code')) + ->setDescription(t('The language code of the test entity.')); $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Name')) diff --git a/core/modules/taxonomy/src/Tests/TermLanguageTest.php b/core/modules/taxonomy/src/Tests/TermLanguageTest.php index 71cacee..0504751 100644 --- a/core/modules/taxonomy/src/Tests/TermLanguageTest.php +++ b/core/modules/taxonomy/src/Tests/TermLanguageTest.php @@ -48,28 +48,28 @@ function testTermLanguage() { // Add a term. $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add'); // Check that we have the language selector. - $this->assertField('edit-langcode', t('The language selector field was found on the page.')); + $this->assertField('edit-langcode-0-value', t('The language selector field was found on the page.')); // Submit the term. $edit = array( 'name[0][value]' => $this->randomMachineName(), - 'langcode' => 'aa', + 'langcode[0][value]' => 'aa', ); $this->drupalPostForm(NULL, $edit, t('Save')); $terms = taxonomy_term_load_multiple_by_name($edit['name[0][value]']); $term = reset($terms); - $this->assertEqual($term->language()->getId(), $edit['langcode'], 'The term contains the correct langcode.'); + $this->assertEqual($term->language()->getId(), $edit['langcode[0][value]'], 'The term contains the correct langcode.'); // Check if on the edit page the language is correct. $this->drupalGet('taxonomy/term/' . $term->id() . '/edit'); - $this->assertOptionSelected('edit-langcode', $edit['langcode'], 'The term language was correctly selected.'); + $this->assertOptionSelected('edit-langcode-0-value', $edit['langcode[0][value]'], 'The term language was correctly selected.'); // Change the language of the term. - $edit['langcode'] = 'bb'; + $edit['langcode[0][value]'] = 'bb'; $this->drupalPostForm('taxonomy/term/' . $term->id() . '/edit', $edit, t('Save')); // Check again that on the edit page the language is correct. $this->drupalGet('taxonomy/term/' . $term->id() . '/edit'); - $this->assertOptionSelected('edit-langcode', $edit['langcode'], 'The term language was correctly selected.'); + $this->assertOptionSelected('edit-langcode-0-value', $edit['langcode[0][value]'], 'The term language was correctly selected.'); } function testDefaultTermLanguage() { @@ -81,7 +81,7 @@ function testDefaultTermLanguage() { ); $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id(), $edit, t('Save')); $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add'); - $this->assertOptionSelected('edit-langcode', 'bb', 'The expected langcode was selected.'); + $this->assertOptionSelected('edit-langcode-0-value', 'bb', 'The expected langcode was selected.'); // Make the default language of the terms to be the current interface. $edit = array( @@ -90,9 +90,9 @@ function testDefaultTermLanguage() { ); $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id(), $edit, t('Save')); $this->drupalGet('aa/admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add'); - $this->assertOptionSelected('edit-langcode', 'aa', "The expected langcode, 'aa', was selected."); + $this->assertOptionSelected('edit-langcode-0-value', 'aa', "The expected langcode, 'aa', was selected."); $this->drupalGet('bb/admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add'); - $this->assertOptionSelected('edit-langcode', 'bb', "The expected langcode, 'bb', was selected."); + $this->assertOptionSelected('edit-langcode-0-value', 'bb', "The expected langcode, 'bb', was selected."); // Change the default language of the site and check if the default terms // language is still correctly selected. @@ -103,6 +103,6 @@ function testDefaultTermLanguage() { ); $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id(), $edit, t('Save')); $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add'); - $this->assertOptionSelected('edit-langcode', 'cc', "The expected langcode, 'cc', was selected."); + $this->assertOptionSelected('edit-langcode-0-value', 'cc', "The expected langcode, 'cc', was selected."); } }