diff --git a/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php b/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php index 0c405dd..f7ac367 100644 --- a/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php +++ b/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Language\LocaleTranslation. + * Contains \Drupal\locale\LocaleTranslation. */ namespace Drupal\locale; @@ -35,7 +35,7 @@ class LocaleTranslation implements TranslatorInterface, DestructableInterface { * Array of \Drupal\locale\LocaleLookup objects indexed by language code * and context. */ - protected $translations; + protected $translations = array(); /** * Constructs a translator using a string storage. diff --git a/core/modules/locale/tests/Drupal/locale/Tests/LocaleTranslationTest.php b/core/modules/locale/tests/Drupal/locale/Tests/LocaleTranslationTest.php new file mode 100644 index 0000000..fdcbbda --- /dev/null +++ b/core/modules/locale/tests/Drupal/locale/Tests/LocaleTranslationTest.php @@ -0,0 +1,47 @@ + 'Locale translation tests', + 'description' => 'Test locale module translatiob implementation.', + 'group' => 'locale', + ); + } + + public function setUp() { + $this->storage = $this->getMock('Drupal\locale\StringStorageInterface'); + } + + /** + * Tests for \Drupal\locale\Tests\LocaleTranslationTest::destruct() + */ + public function testDestruct() { + $translation = new LocaleTranslation($this->storage); + // Prove that destruction works without errors. + $translation->destruct(); + } + +}