class LocaleTranslationTest
Same name in this branch
- 9 core/modules/locale/tests/src/Unit/LocaleTranslationTest.php \Drupal\Tests\locale\Unit\LocaleTranslationTest
Same name and namespace in other branches
- 10 core/modules/locale/tests/src/Unit/LocaleTranslationTest.php \Drupal\Tests\locale\Unit\LocaleTranslationTest
- 10 core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php \Drupal\Tests\locale\Kernel\LocaleTranslationTest
- 11.x core/modules/locale/tests/src/Unit/LocaleTranslationTest.php \Drupal\Tests\locale\Unit\LocaleTranslationTest
- 11.x core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php \Drupal\Tests\locale\Kernel\LocaleTranslationTest
- 8.9.x core/modules/locale/tests/src/Unit/LocaleTranslationTest.php \Drupal\Tests\locale\Unit\LocaleTranslationTest
- 8.9.x core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php \Drupal\Tests\locale\Kernel\LocaleTranslationTest
@coversDefaultClass \Drupal\locale\LocaleTranslation
@group locale
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\locale\Kernel\LocaleTranslationTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of LocaleTranslationTest
File
-
core/
modules/ locale/ tests/ src/ Kernel/ LocaleTranslationTest.php, line 12
Namespace
Drupal\Tests\locale\KernelView source
class LocaleTranslationTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'locale',
];
/**
* Tests that \Drupal\locale\LocaleTranslation is serializable.
*/
public function testSerializable() {
$translation = $this->container
->get('string_translator.locale.lookup');
$this->assertInstanceOf(LocaleTranslation::class, $translation);
// Prove that serialization and deserialization works without errors.
$this->assertNotNull($translation);
$unserialized = unserialize(serialize($translation));
$this->assertInstanceOf(LocaleTranslation::class, $unserialized);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.