Problem/Motivation
Drupal 8 has dropped hook_menu() in favor of hook_menu_links_default(), which in turn has been superseded by the use of YAML files.
Change records here:
Many of the D8 examples still have hook_menu(), and these should be converted.
Also, in accordance with the Examples module checklist, each of these menu paths should have a functional test, to make sure they work properly.
Proposed resolution
The following modules still have hook_menu() implementations:
- block_example #2241405: Update Block example to use *.menu_links.yml, add tests
- cache_example #2277357: Update Cache Example to use *.menu_links.yml, add tests
- dbtng_example #2277359: Update DBTNG Example to test *.menu_links.yml
- email_example #2277361: Update Email Example to use *.menu_links.yml, add tests
- js_example #2218567: Update js_example to demonstrate *.libraries.yml
- node_type_example #2277363: Update Node Type Example to use *.menu_links.yml, add tests
- page_example #2241499: Update Page Example to use *.menu_links.yml, add tests
- phpunit_example #2276929: Update PHPUnit Example to use *.menu_links.yml, add tests
- simpletest_example #2277365: Update SimpleTest Example to use *.menu_links.yml, add tests
- tour_example #2277367: Update Tour Example to use *.menu_links.yml, add tests
For each of these, we need to do the following:
- Convert the module to using *.menu_links.yml files.
- Write a test which verifies that 1) The menu links appear on the front page, and also that 2) A request to each link yields a result of 200. The PHPUnit Example module has a test for the presence of the menu items. We should follow its lead with all of these.
- We can also verify that there is a test which performs drupalGet() on the path, to make sure the route is set up correctly in addition to the menu link.
Create a separate issue for each module and link to it here.
Comments
Comment #1
djevans CreditAttribution: djevans commentedChanged issue title to reflect https://drupal.org/node/2228089.
Comment #2
Mile23Thanks, djevans.
Comment #3
Mile23Comment #4
Mile23Comment #5
Mile23Comment #6
Mile23Comment #7
Mile23Everything accomplished, other than scope change for #2218567: Update js_example to demonstrate *.libraries.yml.
Thanks to everyone who contributed a patch!