diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnable.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnable.php index 427f86f..43a8044 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnable.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnable.php @@ -58,6 +58,16 @@ function testModuleNameLength() { catch (ExtensionNameLengthException $e) { $this->pass($message); } + + // Since for the UI, the submit callback uses FALSE, test that too. + $message = format_string('Exception thrown when enabling as if via the UI the module %name with a name length over the allowed maximum', array('%name' => $module_name)); + try { + module_enable(array($module_name), FALSE); + $this->fail($message); + } + catch (ExtensionNameLengthException $e) { + $this->pass($message); + } } }