LocaleTranslationTest.php in Drupal 8
File
core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php
View source
<?php
namespace Drupal\Tests\locale\Kernel;
use Drupal\locale\LocaleTranslation;
use Drupal\KernelTests\KernelTestBase;
class LocaleTranslationTest extends KernelTestBase {
protected static $modules = [
'locale',
];
public function testSerializable() {
$translation = $this->container
->get('string_translator.locale.lookup');
$this
->assertInstanceOf(LocaleTranslation::class, $translation);
$this
->assertNotNull($translation);
$unserialized = unserialize(serialize($translation));
$this
->assertInstanceOf(LocaleTranslation::class, $unserialized);
}
}