LocaleTranslationTest.php in Drupal 8
File
core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
View source
<?php
namespace Drupal\Tests\locale\Unit;
use Drupal\locale\LocaleTranslation;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\HttpFoundation\RequestStack;
class LocaleTranslationTest extends UnitTestCase {
protected $storage;
protected $languageManager;
protected $requestStack;
protected function setUp() {
$this->storage = $this
->createMock('Drupal\\locale\\StringStorageInterface');
$this->cache = $this
->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
$this->lock = $this
->createMock('Drupal\\Core\\Lock\\LockBackendInterface');
$this->languageManager = $this
->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
$this->requestStack = new RequestStack();
}
public function testDestruct() {
$translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this
->getConfigFactoryStub(), $this->languageManager, $this->requestStack);
$this
->assertAttributeEmpty('translations', $translation);
$translation
->destruct();
}
}