Commit 74e1efed authored by alexpott's avatar alexpott
Browse files

Issue #2563803 by borisson_, DietrichM: Remove deprecated functions from...

Issue #2563803 by borisson_, DietrichM: Remove deprecated functions from core/modules/system/tests/modules/module_test/module_test.module
parent cf276247
......@@ -61,32 +61,6 @@ function module_test_hook_info() {
return $hooks;
}
/**
* Page callback for 'hook dynamic loading' test.
*
* If the hook is dynamically loaded correctly, the menu callback should
* return 'success!'.
*
* @deprecated \Drupal\module_test\Controller\ModuleTestController::hookDynamicLoadingInvoke()
*/
function module_test_hook_dynamic_loading_invoke() {
$result = \Drupal::moduleHandler()->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!'.
*
* @deprecated \Drupal\module_test\Controller\ModuleTestController::hookDynamicLoadingInvokeAll()
*/
function module_test_hook_dynamic_loading_invoke_all() {
$result = \Drupal::moduleHandler()->invokeAll('test_hook');
return $result['module_test'];
}
/**
* Load function used by module_test_hook_dynamic_loading_invoke_all_during_load().
*
......@@ -97,23 +71,6 @@ function module_test_load($param) {
return $result[$param];
}
/**
* 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
* 'Drupal\\module_autoload_test\\SomeClass::testMethod() was invoked.'. If
* that module is not enabled, this function should return nothing.
*
* @deprecated \Drupal\module_test\Controller\ModuleTestController::testClassLoading()
*/
function module_test_class_loading() {
if (class_exists('Drupal\module_autoload_test\SomeClass')) {
$obj = new Drupal\module_autoload_test\SomeClass();
return $obj->testMethod();
}
}
/**
* Implements hook_modules_installed().
*/
......
......@@ -13,24 +13,40 @@
class ModuleTestController {
/**
* @todo Remove module_test_hook_dynamic_loading_invoke().
* Returns dynamically invoked hook results for the 'module_test' module
*
* @return array
* Renderable array.
*/
public function hookDynamicLoadingInvoke() {
return module_test_hook_dynamic_loading_invoke();
$result = \Drupal::moduleHandler()->invoke('module_test', 'test_hook');
return $result['module_test'];
}
/**
* @todo Remove module_test_hook_dynamic_loading_invoke_all().
* Returns dynamically invoked hook results for all modules.
*
* @return array
* Renderable array.
*/
public function hookDynamicLoadingInvokeAll() {
return module_test_hook_dynamic_loading_invoke_all();
$result = \Drupal::moduleHandler()->invokeAll('test_hook');
return $result['module_test'];
}
/**
* @todo Remove module_test_class_loading().
* Returns the result of an autoloaded class's public method.
*
* @return array
* Renderable array.
*/
public function testClassLoading() {
return ['#markup' => module_test_class_loading()];
$markup = NULL;
if (class_exists('Drupal\module_autoload_test\SomeClass')) {
$obj = new \Drupal\module_autoload_test\SomeClass();
$markup = $obj->testMethod();
}
return ['#markup' => $markup];
}
}
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