Form: Fix translation domain detection while running unit tests

This commit is contained in:
Johannes Meyer 2015-03-04 09:38:00 +01:00
parent 6e61980dd2
commit ff263946c8
1 changed files with 2 additions and 1 deletions

View File

@ -1071,10 +1071,11 @@ class Form extends Zend_Form
protected function getTranslationDomain()
{
$parts = explode('\\', get_called_class());
if ($parts[1] === 'Module') {
if (count($parts) > 1 && $parts[1] === 'Module') {
// Assume format Icinga\Module\ModuleName\Forms\...
return strtolower($parts[2]);
}
return 'icinga';
}