diff --git c/core/modules/system/tests/modules/common_test/common_test.module w/core/modules/system/tests/modules/common_test/common_test.module index bd44401..0c6cdb6 100644 --- c/core/modules/system/tests/modules/common_test/common_test.module +++ w/core/modules/system/tests/modules/common_test/common_test.module @@ -21,12 +21,6 @@ function common_test_menu() { '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', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); return $items; } @@ -39,22 +33,6 @@ function common_test_destination() { } /** - * Renders an element with an invalid render array key. - */ -function common_test_drupal_render_invalid_keys() { - define('SIMPLETEST_COLLECT_ERRORS', FALSE); - - // Keys that begin with # may contain a value of any type, otherwise they must - // contain arrays. - $key = 'child'; - $value = 'This should be an array.'; - $element = array( - $key => $value, - ); - return drupal_render($element); -} - -/** * Applies #printed to an element to help test #pre_render. */ function common_test_drupal_render_printing_pre_render($elements) { diff --git c/core/modules/system/tests/modules/common_test/common_test.routing.yml w/core/modules/system/tests/modules/common_test/common_test.routing.yml index b3186c3..fb27e33 100644 --- c/core/modules/system/tests/modules/common_test/common_test.routing.yml +++ w/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_drupal_render_invalid_keys: + pattern: 'common-test/drupal-render-invalid-keys' + defaults: + _title: 'Drupal Render' + _content: '\Drupal\common_test\Controller\CommonTestController::drupalRenderInvalidKeys' + requirements: + _permission: 'access content' diff --git c/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php w/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php index b8e103f..661b37a 100644 --- c/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php +++ w/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestController.php @@ -59,4 +59,18 @@ public function typeLinkActiveClass() { ); } + /** + * Renders an element with an invalid render array key. + * + * @return array + * A render array. + */ + public function drupalRenderInvalidKeys() { + define('SIMPLETEST_COLLECT_ERRORS', FALSE); + // Keys that begin with # may contain a value of any type, otherwise they must + // contain arrays. + $element = array('child' => 'This should be an array.'); + return drupal_render($element); + } + }