diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php index 10664da..87be04c 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php @@ -182,6 +182,23 @@ function testSettingsUI() { $this->assertEqual($definitions['body']->isTranslatable(), $translatable, 'Field translatability correctly switched.'); $this->assertEqual($field->isTranslatable(), $definitions['body']->isTranslatable(), 'Configurable field translatability correctly switched.'); } + // Test that that the order of the languages list is similar to other + // listings like views_ui for UX. + $this->drupalGet('admin/config/regional/content-language'); + + $expected_elements = array( + 'site_default', + 'current_interface', + 'authors_default', + 'en', + 'und', + 'zxx', + ); + $elements = $this->xpath('//select[@id="edit-settings-node-article-settings-language-langcode"]/option'); + // Compare values inside the option elements with expected values. + for ($i = 0; $i < count($elements); $i++) { + $this->assertEqual($elements[$i]->attributes()->{'value'}, $expected_elements[$i]); + } } /** diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml index 7b8490a..9a0b910 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml @@ -39,6 +39,46 @@ display: plugin_id: boolean entity_type: node entity_field: status + langcode: + id: langcode + table: node_field_data + field: langcode + relationship: none + group_type: group + admin_label: '' + operator: in + value: + '***LANGUAGE_language_content***': '***LANGUAGE_language_content***' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + plugin_id: language + entity_type: node + entity_field: langcode pager: options: items_per_page: 10 diff --git a/core/modules/views_ui/src/Tests/ViewEditTest.php b/core/modules/views_ui/src/Tests/ViewEditTest.php index d9cd747..ed552d1 100644 --- a/core/modules/views_ui/src/Tests/ViewEditTest.php +++ b/core/modules/views_ui/src/Tests/ViewEditTest.php @@ -138,6 +138,42 @@ public function testEditFormLanguageOptions() { } else { $this->assertFieldByName('rendering_language', '***LANGUAGE_entity_translation***'); + // Check that the order is consistent with other language selectors like + // in admin/config/regional/content-language. + $expected_elements = array( + '***LANGUAGE_entity_translation***', + '***LANGUAGE_entity_default***', + '***LANGUAGE_site_default***', + '***LANGUAGE_language_interface***', + 'en', + 'hu', + ); + $elements = $this->xpath('//select[@id="edit-rendering-language"]/option'); + // Compare values inside the option elements with expected values. + for ($i = 0; $i < count($elements); $i++) { + $this->assertEqual($elements[$i]->attributes()->{'value'}, $expected_elements[$i]); + } + + // Check the order for the langcode filter. + $langcode_url = 'admin/structure/views/nojs/handler/' . $view_name . '/' . $display . '/filter/langcode'; + $this->drupalGet($langcode_url); + $this->assertResponse(200); + + $expected_elements = array( + 'all', + '***LANGUAGE_site_default***', + '***LANGUAGE_language_interface***', + '***LANGUAGE_language_content***', + 'en', + 'hu', + 'und', + 'zxx', + ); + $elements = $this->xpath('//div[@id="edit-options-value"]//input'); + // Compare values inside the option elements with expected values. + for ($i = 0; $i < count($elements); $i++) { + $this->assertEqual($elements[$i]->attributes()->{'value'}, $expected_elements[$i]); + } } } }