diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module index 36cef57..578edd1 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/core/modules/system/tests/modules/menu_test/menu_test.module @@ -391,7 +391,7 @@ function menu_test_callback() { } /** - * Callback that test menu_test_menu_tree_set_path(). + * Page callback: Tests menu_test_menu_tree_set_path(). */ function menu_test_menu_trail_callback() { $menu_path = state()->get('menu_test.menu_tree_set_path') ?: array(); @@ -414,7 +414,7 @@ function menu_test_init() { } /** - * Callback for our custom 403 and 404 pages. + * Page callback: Used for custom 403 and 404 pages. */ function menu_test_custom_403_404_callback() { // When requested by one of the MenuTrailTestCase tests, record the final @@ -428,12 +428,13 @@ function menu_test_custom_403_404_callback() { } /** - * Page callback to use when testing the theme callback functionality. + * Page callback: Used when testing the theme callback functionality. * - * @param $inherited + * @param bool $inherited * An optional boolean to set to TRUE when the requested page is intended to * inherit the theme of its parent. - * @return + * + * @return string * A string describing the requested custom theme and actual theme being used * for the current page request. */ @@ -452,11 +453,12 @@ function menu_test_theme_page_callback($inherited = FALSE) { } /** - * Theme callback to use when testing the theme callback functionality. + * Theme callback: Used when testing the theme callback functionality. * - * @param $argument + * @param string $argument * The argument passed in from the URL. - * @return + * + * @return string * The name of the custom theme to request for the current page. */ function menu_test_theme_callback($argument) { @@ -480,7 +482,7 @@ function menu_test_theme_callback($argument) { /** * Implement hook_custom_theme(). * - * @return + * @return string * The name of the custom theme to use for the current page. */ function menu_test_custom_theme() { @@ -493,12 +495,14 @@ function menu_test_custom_theme() { } /** - * Helper function for the testMenuName() test. Used to change the menu_name - * parameter of a menu. + * Used to change the menu_name parameter of a menu. * - * @param $new_name + * Helper function for the testMenuName() test. + * + * @param string $new_name * If set, will change the menu_name value. - * @return + * + * @return string * The menu_name value to use. */ function menu_test_menu_name($new_name = '') { @@ -544,6 +548,7 @@ function menu_test_menu_link_delete($item) { * * @param $value * The value to set or NULL to return the current value. + * * @return * A text string for comparison to test assertions. */ @@ -566,19 +571,19 @@ function menu_test_menu_site_status_alter(&$menu_site_status, $path) { } /** - * Menu callback to be used as a login path. + * Page callback: Used as a login path. */ function menu_login_callback() { return 'This is menu_login_callback().'; } /** - * Concatenates a string, by using the t() function and a case number. + * Page callback: Concatenates the title and case number. * - * @param $title + * @param string $title * Title string. - * @param $case_number - * The current case number which is tests (defaults to 3). + * @param string $case_number + * (optional) The case number (defaults to 3). */ function menu_test_title_callback($title, $case_no = 3) { return t($title) . ' - Case ' . $case_no; diff --git a/core/modules/system/tests/modules/module_test/module_test.module b/core/modules/system/tests/modules/module_test/module_test.module index 1d35ea9..15fc3c3 100644 --- a/core/modules/system/tests/modules/module_test/module_test.module +++ b/core/modules/system/tests/modules/module_test/module_test.module @@ -93,7 +93,7 @@ function module_test_menu() { } /** - * Page callback for 'hook dynamic loading' test. + * Page callback: For 'hook dynamic loading' test. * * If the hook is dynamically loaded correctly, the menu callback should * return 'success!'. @@ -104,7 +104,7 @@ function module_test_hook_dynamic_loading_invoke() { } /** - * Page callback for 'hook dynamic loading' test. + * Page callback: For 'hook dynamic loading' test. * * If the hook is dynamically loaded correctly, the menu callback should * return 'success!'. @@ -115,7 +115,7 @@ function module_test_hook_dynamic_loading_invoke_all() { } /** - * Page callback for 'hook dynamic loading' test. + * Page callback: For 'hook dynamic loading' test. * * If the hook is dynamically loaded correctly, the menu callback should * return 'success!'. @@ -125,8 +125,9 @@ function module_test_hook_dynamic_loading_invoke_all_during_load($param) { } /** - * Load function used by module_test_hook_dynamic_loading_invoke_all_during_load(). + * Invokes all 'test_hook' implementations. * + * @see module_test_hook_dynamic_loading_invoke_all_during_load() * @see module_test_menu(). */ function module_test_load($param) { @@ -135,7 +136,7 @@ function module_test_load($param) { } /** - * Page callback for 'class loading' test. + * Page callback: For 'class loading' test. * * This module does not have a dependency on module_autoload_test.module. If * that module is enabled, this function should return the string diff --git a/core/modules/system/tests/modules/plugin_test/plugin_test.module b/core/modules/system/tests/modules/plugin_test/plugin_test.module index 45f89cf..84b4712 100644 --- a/core/modules/system/tests/modules/plugin_test/plugin_test.module +++ b/core/modules/system/tests/modules/plugin_test/plugin_test.module @@ -30,7 +30,7 @@ function plugin_test_menu() { } /** - * A simple page callback that prints plugin labels for testing. + * Page callback: Prints plugin labels for testing. * * @return array * A simple renderable array of plugin labels. diff --git a/core/modules/system/tests/modules/session_test/session_test.module b/core/modules/system/tests/modules/session_test/session_test.module index b3e82fd..5cbf97e 100644 --- a/core/modules/system/tests/modules/session_test/session_test.module +++ b/core/modules/system/tests/modules/session_test/session_test.module @@ -65,7 +65,7 @@ function session_test_menu() { } /** - * Page callback, prints the stored session value to the screen. + * Page callback: Prints the stored session value to the screen. */ function _session_test_get() { if (!empty($_SESSION['session_test_value'])) { @@ -77,7 +77,7 @@ function _session_test_get() { } /** - * Page callback, stores a value in $_SESSION['session_test_value']. + * Page callback: Stores a value in $_SESSION['session_test_value']. */ function _session_test_set($value) { $_SESSION['session_test_value'] = $value; @@ -85,8 +85,7 @@ function _session_test_set($value) { } /** - * Menu callback: turns off session saving and then tries to save a value - * anyway. + * Page callback: Attempts to save a value with after disabling session. */ function _session_test_no_set($value) { drupal_save_session(FALSE); @@ -95,7 +94,7 @@ function _session_test_no_set($value) { } /** - * Menu callback: print the current session ID. + * Page callback: Prints the current session ID. */ function _session_test_id() { // Set a value in $_SESSION, so that drupal_session_commit() will start @@ -108,14 +107,14 @@ function _session_test_id() { } /** - * Menu callback: print the current session ID as read from the cookie. + * Page callback: Prints the current session ID as read from the cookie. */ function _session_test_id_from_cookie() { return 'session_id:' . $_COOKIE[session_name()] . "\n"; } /** - * Menu callback, sets a message to me displayed on the following page. + * Page callback: Sets a message to be displayed on the following page. */ function _session_test_set_message() { drupal_set_message(t('This is a dummy message.')); @@ -126,7 +125,7 @@ function _session_test_set_message() { } /** - * Menu callback, sets a message but call drupal_save_session(FALSE). + * Page callback: Sets a message, but doesn't save session. */ function _session_test_set_message_but_dont_save() { drupal_save_session(FALSE); @@ -134,8 +133,7 @@ function _session_test_set_message_but_dont_save() { } /** - * Menu callback, stores a value in $_SESSION['session_test_value'] without - * having started the session in advance. + * Page callback: Sets a session value without an initiated session. */ function _session_test_set_not_started() { if (!drupal_session_will_start()) { @@ -164,7 +162,7 @@ function session_test_form_user_login_form_alter(&$form) { /** * Implements hook_drupal_goto_alter(). * - * Force the redirection to go to a non-secure page after being on a secure + * Force the redirection to go to a non-secure page after being on a secur * page through https.php. */ function session_test_drupal_goto_alter(&$path, &$options, &$http_response_code) { @@ -178,7 +176,7 @@ function session_test_drupal_goto_alter(&$path, &$options, &$http_response_code) } /** - * Menu callback, only available if current user is logged in. + * Page callback: Only available if current user is logged in. */ function _session_test_is_logged_in() { return t('User is logged in.'); diff --git a/core/modules/system/tests/modules/system_test/system_test.module b/core/modules/system/tests/modules/system_test/system_test.module index 4494299..342304b 100644 --- a/core/modules/system/tests/modules/system_test/system_test.module +++ b/core/modules/system/tests/modules/system_test/system_test.module @@ -109,10 +109,21 @@ function system_test_menu() { return $items; } +/** + * Page callback: Wrapper for PHP's sleep() function. + * + * @param + * The number of seconds to delay processing. + * + * @see http://php.net/manual/function.sleep.php + */ function system_test_sleep($seconds) { sleep($seconds); } +/** + * Page callback: Sets header from query string. + */ function system_test_basic_auth_page() { $output = t('$_SERVER[\'PHP_AUTH_USER\'] is @username.', array('@username' => $_SERVER['PHP_AUTH_USER'])); $output .= t('$_SERVER[\'PHP_AUTH_PW\'] is @password.', array('@password' => $_SERVER['PHP_AUTH_PW'])); @@ -130,7 +141,7 @@ function system_test_redirect($code) { } /** - * Menu callback; sends a redirect header to itself until $count argument is 0. + * Page callback: Sends a redirect header to itself until $count argument is 0. * * Emulates the variable number of redirects (given by initial $count argument) * to the final destination URL by continuous sending of 301 HTTP redirect @@ -153,21 +164,33 @@ function system_test_multiple_redirects($count) { return ''; } +/** + * Page callback: Sets header from query string. + */ function system_test_set_header() { drupal_add_http_header($_GET['name'], $_GET['value']); return t('The following header was set: %name: %value', array('%name' => $_GET['name'], '%value' => $_GET['value'])); } +/** + * Page callback: Sets local redirect. + */ function system_test_redirect_noscheme() { header("Location: localhost/path", TRUE, 301); exit; } +/** + * Page callback: Sets invalid header. + */ function system_test_redirect_noparse() { header("Location: http:///path", TRUE, 301); exit; } +/** + * Page callback: Sets 301 redirect to FTP path. + */ function system_test_redirect_invalid_scheme() { header("Location: ftp://localhost/path", TRUE, 301); exit; @@ -319,14 +342,14 @@ function system_test_page_build(&$page) { } /** - * Menu callback to test main content fallback(). + * Page callback: Tests main content fallback(). */ function system_test_main_content_fallback() { return t('Content to test main content fallback'); } /** - * A simple page callback which adds a register shutdown function. + * Page callback: Adds a register shutdown function. */ function system_test_page_shutdown_functions($arg1, $arg2) { drupal_register_shutdown_function('_system_test_first_shutdown_function', $arg1, $arg2); @@ -371,7 +394,7 @@ function system_test_filetransfer_info() { } /** - * Page callback to initialize authorize.php during testing. + * Page callback: Initializes authorize.php during testing. * * @see system_authorized_init(). */ diff --git a/core/modules/system/tests/modules/taxonomy_test/taxonomy_test.module b/core/modules/system/tests/modules/taxonomy_test/taxonomy_test.module index 2c6c00a..a11c224 100644 --- a/core/modules/system/tests/modules/taxonomy_test/taxonomy_test.module +++ b/core/modules/system/tests/modules/taxonomy_test/taxonomy_test.module @@ -103,6 +103,9 @@ function taxonomy_test_form_taxonomy_term_form_alter(&$form, $form_state, $form_ /** * Return the antonym of the given term ID. + * + * @param int $tid + * The taxonomy term ID. */ function taxonomy_test_get_antonym($tid) { return db_select('taxonomy_term_antonym', 'ta') diff --git a/core/modules/system/tests/modules/test_page_test/test_page_test.module b/core/modules/system/tests/modules/test_page_test/test_page_test.module index 71a804c..0edc6d7 100644 --- a/core/modules/system/tests/modules/test_page_test/test_page_test.module +++ b/core/modules/system/tests/modules/test_page_test/test_page_test.module @@ -1,6 +1,11 @@