protected function MediaTranslationTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Kernel/MediaTranslationTest.php \Drupal\Tests\media\Kernel\MediaTranslationTest::setUp()
- 10 core/modules/media/tests/src/Kernel/MediaTranslationTest.php \Drupal\Tests\media\Kernel\MediaTranslationTest::setUp()
Overrides MediaKernelTestBase::setUp
File
- core/
modules/ media/ tests/ src/ Kernel/ MediaTranslationTest.php, line 33
Class
- MediaTranslationTest
- Tests multilanguage fields logic.
Namespace
Drupal\Tests\media\KernelCode
protected function setUp() : void {
parent::setUp();
$this
->installConfig([
'language',
]);
// Create a test media type for translations.
$this->testTranslationMediaType = $this
->createMediaType('test_translation');
for ($i = 0; $i < 3; ++$i) {
$language_id = 'l' . $i;
ConfigurableLanguage::create([
'id' => $language_id,
'label' => $this
->randomString(),
])
->save();
file_put_contents('public://' . $language_id . '.png', '');
}
}