function ModuleHandlerTest::testGetModuleWithNonExistingModule

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testGetModuleWithNonExistingModule()
  2. 10 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testGetModuleWithNonExistingModule()
  3. 11.x 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 165

Class

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

Namespace

Drupal\Tests\Core\Extension

Code

public function testGetModuleWithNonExistingModule() {
    $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.