diff --git a/core/modules/locale/tests/Drupal/locale/Tests/LocaleTranslationTest.php b/core/modules/locale/tests/Drupal/locale/Tests/LocaleTranslationTest.php index e82d0e0..34c24a8 100644 --- a/core/modules/locale/tests/Drupal/locale/Tests/LocaleTranslationTest.php +++ b/core/modules/locale/tests/Drupal/locale/Tests/LocaleTranslationTest.php @@ -25,6 +25,13 @@ class LocaleTranslationTest extends UnitTestCase { */ protected $storage; + /** + * A mocked language manager built from LanguageManagerInterface. + * + * @var \Drupal\Core\Language\LanguageManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $languageManager; + public static function getInfo() { return array( 'name' => 'Locale translation tests', @@ -40,13 +47,14 @@ protected function setUp() { $this->storage = $this->getMock('Drupal\locale\StringStorageInterface'); $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface'); $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface'); + $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface'); } /** * Tests for \Drupal\locale\LocaleTranslation::destruct() */ public function testDestruct() { - $translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this->getConfigFactoryStub()); + $translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this->getConfigFactoryStub(), $this->languageManager); // Prove that destruction works without errors when translations are empty. $this->assertAttributeEmpty('translations', $translation); $translation->destruct();