public function ExtensionListTest::testGetNameWithNonExistingExtension in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php \Drupal\Tests\Core\Extension\ExtensionListTest::testGetNameWithNonExistingExtension()
- 9 core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php \Drupal\Tests\Core\Extension\ExtensionListTest::testGetNameWithNonExistingExtension()
@covers ::getName
File
- core/
tests/ Drupal/ Tests/ Core/ Extension/ ExtensionListTest.php, line 27
Class
- ExtensionListTest
- @coversDefaultClass \Drupal\Core\Extension\ExtensionList @group Extension
Namespace
Drupal\Tests\Core\ExtensionCode
public function testGetNameWithNonExistingExtension() {
[
$cache,
$info_parser,
$module_handler,
$state,
] = $this
->getMocks();
$test_extension_list = new TestExtension($this
->randomMachineName(), 'test_extension', $cache
->reveal(), $info_parser
->reveal(), $module_handler
->reveal(), $state
->reveal(), 'testing');
$extension_discovery = $this
->prophesize(ExtensionDiscovery::class);
$extension_discovery
->scan('test_extension')
->willReturn([]);
$test_extension_list
->setExtensionDiscovery($extension_discovery
->reveal());
$this
->expectException(UnknownExtensionException::class);
$test_extension_list
->getName('test_name');
}