function ModuleHandlerTest::testInvalidGetName
Same name in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php \Drupal\KernelTests\Core\Extension\ModuleHandlerTest::testInvalidGetName()
- 10 core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php \Drupal\KernelTests\Core\Extension\ModuleHandlerTest::testInvalidGetName()
- 11.x core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php \Drupal\KernelTests\Core\Extension\ModuleHandlerTest::testInvalidGetName()
Tests requesting the name of an invalid module.
@covers ::getName
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Extension/ ModuleHandlerTest.php, line 20
Class
- ModuleHandlerTest
- @coversDefaultClass \Drupal\Core\Extension\ModuleHandler
Namespace
Drupal\KernelTests\Core\ExtensionCode
public function testInvalidGetName() {
$this->expectException(UnknownExtensionException::class);
$this->expectExceptionMessage('The module module_nonsense does not exist.');
$module_handler = $this->container
->get('module_handler');
$module_handler->getName('module_nonsense');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.