diff --git a/core/modules/system/tests/modules/common_test/common_test.module b/core/modules/system/tests/modules/common_test/common_test.module index bd44401..71b7daf 100644 --- a/core/modules/system/tests/modules/common_test/common_test.module +++ b/core/modules/system/tests/modules/common_test/common_test.module @@ -15,12 +15,6 @@ function common_test_menu() { 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); - $items['common-test/query-string'] = array( - 'title' => 'Test querystring', - 'page callback' => 'common_test_js_and_css_querystring', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); $items['common-test/drupal-render-invalid-keys'] = array( 'title' => 'Drupal Render', 'page callback' => 'common_test_drupal_render_invalid_keys', @@ -235,18 +229,6 @@ function common_test_library_info() { } /** - * Adds a JavaScript file and a CSS file with a query string appended. - */ -function common_test_js_and_css_querystring() { - drupal_add_library('system', 'drupalSettings'); - drupal_add_js(drupal_get_path('module', 'node') . '/node.js'); - drupal_add_css(drupal_get_path('module', 'node') . '/css/node.admin.css'); - // A relative URI may have a query string. - drupal_add_css('/' . drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&arg2=value2'); - return ''; -} - -/** * Implements hook_cron(). * * System module should handle if a module does not catch an exception and keep diff --git a/core/modules/system/tests/modules/common_test/common_test.routing.yml b/core/modules/system/tests/modules/common_test/common_test.routing.yml index b3186c3..f3ad504 100644 --- a/core/modules/system/tests/modules/common_test/common_test.routing.yml +++ b/core/modules/system/tests/modules/common_test/common_test.routing.yml @@ -4,3 +4,10 @@ common_test_l_active_class: _content: '\Drupal\common_test\Controller\CommonTestController::typeLinkActiveClass' requirements: _access: 'TRUE' +common_test_js_and_css_querystring: + pattern: 'common-test/query-string' + defaults: + _title: 'Test querystring' + _content: '\Drupal\common_test\Controller\CommonTestController::jsAndCssQuerystring' + requirements: + _permission: 'access content' diff --git a/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php b/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php index 77b8606..dd75381 100644 --- a/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php +++ b/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php @@ -59,4 +59,16 @@ public function typeLinkActiveClass() { ); } + /** + * Adds a JavaScript file and a CSS file with a query string appended. + */ + public function jsAndCssQuerystring() { + drupal_add_library('system', 'drupalSettings'); + drupal_add_js(drupal_get_path('module', 'node') . '/node.js'); + drupal_add_css(drupal_get_path('module', 'node') . '/css/node.admin.css'); + // A relative URI may have a query string. + drupal_add_css('/' . drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&arg2=value2'); + return ''; + } + }