ModuleHandlerTest.php
Same filename in this branch
Same filename in other branches
- 8.9.x core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
- 8.9.x core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php
- 8.9.x core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
- 10 core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
- 10 core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php
- 10 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
- 11.x core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
- 11.x core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php
- 11.x core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
Namespace
Drupal\KernelTests\Core\ExtensionFile
-
core/
tests/ Drupal/ KernelTests/ Core/ Extension/ ModuleHandlerTest.php
View source
<?php
namespace Drupal\KernelTests\Core\Extension;
use Drupal\Core\Extension\Exception\UnknownExtensionException;
use Drupal\KernelTests\KernelTestBase;
/**
* @coversDefaultClass \Drupal\Core\Extension\ModuleHandler
*
* @group Extension
*/
class ModuleHandlerTest extends KernelTestBase {
/**
* Tests requesting the name of an invalid module.
*
* @covers ::getName
*/
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');
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
ModuleHandlerTest | @coversDefaultClass \Drupal\Core\Extension\ModuleHandler |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.