You are here

public function ModuleHandlerDeprecatedHookUnimplementedTest::testUnimplementedHooks in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookUnimplementedTest.php \Drupal\KernelTests\Core\Extension\ModuleHandlerDeprecatedHookUnimplementedTest::testUnimplementedHooks()
  2. 10 core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookUnimplementedTest.php \Drupal\KernelTests\Core\Extension\ModuleHandlerDeprecatedHookUnimplementedTest::testUnimplementedHooks()

@covers ::alterDeprecated @covers ::invokeAllDeprecated @covers ::invokeDeprecated @doesNotPerformAssertions

File

core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookUnimplementedTest.php, line 22

Class

ModuleHandlerDeprecatedHookUnimplementedTest
Test whether unimplemented deprecated hook invocations trigger errors.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testUnimplementedHooks() {
  $unimplemented_hook_name = 'unimplemented_hook_name';

  /* @var $module_handler \Drupal\Core\Extension\ModuleHandlerInterface */
  $module_handler = $this->container
    ->get('module_handler');
  $module_handler
    ->invokeDeprecated('Use something else.', 'deprecation_test', $unimplemented_hook_name);
  $module_handler
    ->invokeAllDeprecated('Use something else.', $unimplemented_hook_name);
  $data = [];
  $module_handler
    ->alterDeprecated('Alter something else.', $unimplemented_hook_name, $data);
}