diff --git a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php index c790a84..4ee66ca 100644 --- a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php +++ b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php @@ -31,4 +31,18 @@ function functionTemplateOverridden() { ); } + /** + * Menu callback for testing suggestion alter hooks with template files. + */ + function suggestionAlter() { + return array('#theme' => 'theme_test_suggestions'); + } + + /** + * Menu callback for testing suggestion alter hooks with theme functions. + */ + function functionSuggestionAlter() { + return array('#theme' => 'theme_test_function_suggestions'); + } + } diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module index 1d10b00..e8d1134 100644 --- a/core/modules/system/tests/modules/theme_test/theme_test.module +++ b/core/modules/system/tests/modules/theme_test/theme_test.module @@ -60,14 +60,12 @@ function theme_test_menu() { 'type' => MENU_CALLBACK, ); $items['theme-test/suggestion-alter'] = array( - 'page callback' => 'theme_test_suggestion_alter', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, + 'title' => 'Test suggestion alter hook for template files', + 'route_name' => 'suggestion_alter', ); $items['theme-test/function-suggestion-alter'] = array( - 'page callback' => 'theme_test_function_suggestion_alter', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, + 'title' => 'Test suggestion alter hook for theme functions', + 'route_name' => 'function_suggestion_alter', ); $items['theme-test/alter'] = array( 'title' => 'Suggestion', @@ -211,34 +209,6 @@ function theme_theme_test_render_element_children($variables) { } /** - * Page callback: Displays theme suggestions test data. - * - * Used for testing theme hooks defined as template files. - * - * @return array - * A render array to generate theme suggestions test output. - * - * @see theme_test_menu() - */ -function theme_test_suggestion_alter() { - return array('#theme' => 'theme_test_suggestions'); -} - -/** - * Page callback: Displays theme suggestions test data. - * - * Used for testing theme hooks defined as theme functions. - * - * @return array - * A render array to generate theme suggestions test output. - * - * @see theme_test_menu() - */ -function theme_test_function_suggestion_alter() { - return array('#theme' => 'theme_test_function_suggestions'); -} - -/** * Returns HTML for a theme function suggestion test. */ function theme_theme_test_function_suggestions($variables) { diff --git a/core/modules/system/tests/modules/theme_test/theme_test.routing.yml b/core/modules/system/tests/modules/theme_test/theme_test.routing.yml index 866171e..709d86e 100644 --- a/core/modules/system/tests/modules/theme_test/theme_test.routing.yml +++ b/core/modules/system/tests/modules/theme_test/theme_test.routing.yml @@ -4,3 +4,15 @@ function_template_override: _content: '\Drupal\theme_test\ThemeTestController::functionTemplateOverridden' requirements: _permission: 'access content' +suggestion_alter: + pattern: '/theme-test/suggestion-alter' + defaults: + _content: '\Drupal\theme_test\ThemeTestController::suggestionAlter' + requirements: + _permission: 'access content' +function_suggestion_alter: + pattern: '/theme-test/function-suggestion-alter' + defaults: + _content: '\Drupal\theme_test\ThemeTestController::functionSuggestionAlter' + requirements: + _permission: 'access content'