Commit 12dbf59a authored by larowlan's avatar larowlan

Issue #3000677 by catch, Shane Birley, featherbelly, alexpott, larowlan: Fatal...

Issue #3000677 by catch, Shane Birley, featherbelly, alexpott, larowlan: Fatal error after upgrade to 8.6x [due to regression in extension system]
parent e91e2874
......@@ -777,7 +777,12 @@ public function getModuleDirectories() {
* {@inheritdoc}
*/
public function getName($module) {
try {
return \Drupal::service('extension.list.module')->getName($module);
}
catch (UnknownExtensionException $e) {
return $module;
}
}
}
<?php
namespace Drupal\KernelTests\Core\Extension;
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() {
$module_handler = $this->container->get('module_handler');
$this->assertSame('module_nonsense', $module_handler->getName('module_nonsense'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment