diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display_menu.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display_menu.yml index a1eb3b5..d0219e9 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display_menu.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display_menu.yml @@ -120,3 +120,28 @@ display: display_title: Page id: page_5 position: 0 + page_6: + display_options: + path: test_page_display_menu/test_default_local_task/one + title: 'Tests a default local task without an existing parent' + menu: + type: 'default tab' + title: 'Test child' + description: '' + expanded: false + parent: '' + menu_name: main + weight: 0 + context: '0' + tab_options: + type: tab + title: 'Test parent' + description: '' + menu_name: main + weight: 0 + defaults: + title: false + display_plugin: page + display_title: Page + id: page_6 + position: 0 diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php index 501d922..180492b 100644 --- a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php @@ -108,6 +108,16 @@ public function testPageDisplayMenu() { $this->assertEqual($element[0]->getText(), t('Test local tab')); $this->assertTitle(t('Test local page | Drupal')); + // Check that a parent local task is created for a default local task. + $this->drupalGet('test_page_display_menu/test_default_local_task'); + $this->assertResponse(200); + $element = $this->xpath('//ul[contains(@class, :ul_class)]//a[contains(@class, :a_class)]/child::text()', [ + ':ul_class' => 'tabs primary', + ':a_class' => 'is-active', + ]); + $this->assertEqual($element[0]->getText(), t('Test parent')); + $this->assertTitle(t('Tests a default local task without an existing parent | Drupal')); + // Check an ordinary menu link. $admin_user = $this->drupalCreateUser(['administer menu']); $this->drupalLogin($admin_user);