diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php index fe12b2b..356dd79 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php @@ -19,7 +19,7 @@ class ViewEditTest extends UITestBase { * * @var array */ - public static $testViews = array('test_view'); + public static $testViews = array('test_view', 'test_display'); public static function getInfo() { return array( @@ -45,4 +45,29 @@ public function testDeleteLink() { $this->assertFalse($view instanceof View); } + /** + * Tests the 'Other' options category on the views edit form. + */ + public function testEditFormOtherOptions() { + // Test the Field language form. + $this->drupalGet('admin/structure/views/view/test_view'); + $langcode_url = 'admin/structure/views/nojs/display/test_view/default/field_langcode'; + $this->assertLinkByHref($langcode_url); + $this->assertLink(t("Current user's language")); + // Click the link and check the form before language is enabled. + $this->drupalGet($langcode_url); + $this->assertResponse(200); + $this->assertText(t("You don't have translatable entity types.")); + // A node view should have language options. + module_enable(array('node', 'language')); + $this->resetAll(); + $this->rebuildContainer(); + entity_info_cache_clear(); + + $this->drupalGet('admin/structure/views/nojs/display/test_display/page_1/field_langcode'); + $this->assertResponse(200); + $this->assertFieldByName('field_langcode', '***CURRENT_LANGUAGE***'); + $this->assertFieldByName('field_langcode_add_to_query', TRUE); + } + }