diff --git a/core/modules/language/tests/src/Functional/LanguageListTest.php b/core/modules/language/tests/src/Functional/LanguageListTest.php index bdbda9e..f8a0b35 100644 --- a/core/modules/language/tests/src/Functional/LanguageListTest.php +++ b/core/modules/language/tests/src/Functional/LanguageListTest.php @@ -176,9 +176,20 @@ function testLanguageList() { $this->assertResponse(403, 'Can not delete locked language'); // Ensure that NL cannot be set default when it's not available. + // First create the NL language. + $edit = array( + 'predefined_langcode' => 'nl', + ); + $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language'); + + // Load the form which has now the additional NL language option. $this->drupalGet('admin/config/regional/language'); - $extra_values = '&site_default_language=nl'; - $this->drupalPostForm(NULL, array(), t('Save configuration'), array(), array(), NULL, $extra_values); + + // Delete the NL language in the background. + $language_storage = $this->container->get('entity_type.manager')->getStorage('configurable_language'); + $language_storage->load('nl')->delete(); + + $this->drupalPostForm(NULL, array('site_default_language' => 'nl'), 'Save configuration'); $this->assertText(t('Selected default language no longer exists.')); $this->assertNoFieldChecked('edit-site-default-language-xx', 'The previous default language got deselected.'); } diff --git a/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php b/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php index 6919c26..5ab3662 100644 --- a/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php +++ b/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php @@ -57,9 +57,11 @@ function testLanguageLocaleList() { // Get language list displayed in select list. $this->drupalGet('fr/admin/config/regional/language/add'); - $select = $this->xpath('//select[@id="edit-predefined-langcode"]'); - $select_element = (array) end($select); - $options = $select_element['option']; + $option_elements = $this->xpath('//select[@id="edit-predefined-langcode/option"]'); + $options = []; + foreach ($option_elements as $option_element) { + $options[] = $option_element->getText(); + } // Remove the 'Custom language...' option form the end. array_pop($options); // Order language list. diff --git a/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php b/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php index dd8894e..8f2b5e0 100644 --- a/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php +++ b/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php @@ -82,7 +82,7 @@ public function testLanguageStringSelector() { $elements = $this->xpath('//select[@id=:id]//option[@value=:option]', array(':id' => 'edit-settings-user-user-settings-language-langcode', ':option' => 'en')); // Check that the language text is translated. - $this->assertEqual((string) $elements[0], $name_translation, 'Checking the option string English is translated to Spanish.'); + $this->assertEqual($elements[0]->getText(), $name_translation, 'Checking the option string English is translated to Spanish.'); } }