function MediaTranslationTest::setUp
Same name in other branches
- 9 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()
- 11.x 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() {
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', '');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.