From a68bfbd21bc0761da95978fe3d4fa77df4bd0248 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Tue, 8 Nov 2016 10:28:06 -0800 Subject: [PATCH] Fix config menu route - Fixes #56 --- message_subscribe.links.menu.yml | 2 +- message_subscribe.routing.yml | 2 +- tests/src/Functional/MenuTest.php | 39 +++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 tests/src/Functional/MenuTest.php diff --git a/message_subscribe.links.menu.yml b/message_subscribe.links.menu.yml index 9d63da0..b94f6c9 100644 --- a/message_subscribe.links.menu.yml +++ b/message_subscribe.links.menu.yml @@ -2,4 +2,4 @@ message_subscribe.admin_settings: route_name: message_subscribe.admin_settings title: 'Message subscribe settings' description: 'Administer message subscribe' - parent: system.admin_config_system + parent: message.main_settings diff --git a/message_subscribe.routing.yml b/message_subscribe.routing.yml index aa0bcfb..9536145 100644 --- a/message_subscribe.routing.yml +++ b/message_subscribe.routing.yml @@ -1,5 +1,5 @@ message_subscribe.admin_settings: - path: /admin/config/system/message-subscribe + path: /admin/config/message/message-subscribe defaults: _title: 'Message subscribe settings' _form: \Drupal\message_subscribe\Form\MessageSubscribeAdminSettings diff --git a/tests/src/Functional/MenuTest.php b/tests/src/Functional/MenuTest.php new file mode 100644 index 0000000..4b237f1 --- /dev/null +++ b/tests/src/Functional/MenuTest.php @@ -0,0 +1,39 @@ +drupalCreateUser([], NULL, TRUE); + $this->drupalLogin($admin); + + // Link should appear on main config page. + $this->drupalGet(Url::fromRoute('system.admin_config')); + $this->assertSession()->linkExists(t('Message subscribe settings')); + + // Link should be on the message-specific overview page. + $this->drupalGet(Url::fromRoute('message.main_settings')); + $this->assertSession()->linkExists(t('Message subscribe settings')); + + $this->clickLink(t('Message subscribe settings')); + $this->assertSession()->statusCodeEquals(200); + } + +}