function ModuleHandlerTest::testGetModuleWithNonExistingModule

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testGetModuleWithNonExistingModule()
  2. 8.9.x core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testGetModuleWithNonExistingModule()
  3. 10 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testGetModuleWithNonExistingModule()

@covers ::getModule

File

core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php, line 163

Class

ModuleHandlerTest
@coversDefaultClass \Drupal\Core\Extension\ModuleHandler @runTestsInSeparateProcesses

Namespace

Drupal\Tests\Core\Extension

Code

public function testGetModuleWithNonExistingModule() : void {
    $this->expectException(UnknownExtensionException::class);
    $this->getModuleHandler()
        ->getModule('claire_alice_watch_my_little_pony_module_that_does_not_exist');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.