summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/module_test.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/tests/module_test.module')
-rw-r--r--modules/simpletest/tests/module_test.module39
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/simpletest/tests/module_test.module b/modules/simpletest/tests/module_test.module
index b1f7361a0..d3f46e2cb 100644
--- a/modules/simpletest/tests/module_test.module
+++ b/modules/simpletest/tests/module_test.module
@@ -52,6 +52,45 @@ function module_test_hook_info() {
}
/**
+ * Implements hook_menu().
+ */
+function module_test_menu() {
+ $items['module-test/hook-dynamic-loading-invoke'] = array(
+ 'title' => 'Test hook dynamic loading (invoke)',
+ 'page callback' => 'module_test_hook_dynamic_loading_invoke',
+ 'access arguments' => array('access content'),
+ );
+ $items['module-test/hook-dynamic-loading-invoke-all'] = array(
+ 'title' => 'Test hook dynamic loading (invoke_all)',
+ 'page callback' => 'module_test_hook_dynamic_loading_invoke_all',
+ 'access arguments' => array('access content'),
+ );
+ return $items;
+}
+
+/**
+ * Page callback for 'hook dynamic loading' test.
+ *
+ * If the hook is dynamically loaded correctly, the menu callback should
+ * return 'success!'.
+ */
+function module_test_hook_dynamic_loading_invoke() {
+ $result = module_invoke('module_test', 'test_hook');
+ return $result['module_test'];
+}
+
+/**
+ * Page callback for 'hook dynamic loading' test.
+ *
+ * If the hook is dynamically loaded correctly, the menu callback should
+ * return 'success!'.
+ */
+function module_test_hook_dynamic_loading_invoke_all() {
+ $result = module_invoke_all('test_hook');
+ return $result['module_test'];
+}
+
+/**
* Implements hook_modules_enabled().
*/
function module_test_modules_enabled($modules) {