Commit 7470a188 authored by alexpott's avatar alexpott
Browse files

Issue #2066523 by mparker17, disasm: Convert...

Issue #2066523 by mparker17, disasm: Convert common_test_drupal_render_invalid_keys() to a new style controller.
parent 678df35b
......@@ -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;
}
......@@ -38,22 +32,6 @@ function common_test_destination() {
print "The destination: " . check_plain($destination['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.
*/
......
......@@ -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'
......@@ -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);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment