public function LibraryInclusionTranslationTest::testVideo in Lightning Media 8.3
File
- modules/
lightning_media_video/ tests/ src/ Kernel/ LibraryInclusionTranslationTest.php, line 57
Class
- LibraryInclusionTranslationTest
- @group lightning_media @group lightning_media_video
Namespace
Drupal\Tests\lightning_media_video\KernelCode
public function testVideo() {
$media = Media::create([
'bundle' => 'video',
'name' => $this
->randomString(),
'field_media_video_embed_field' => $this
->randomString(),
'field_media_in_library' => TRUE,
]);
$media
->addTranslation('hu', [
'field_media_in_library' => FALSE,
]);
$this
->assertSame(SAVED_NEW, $media
->save());
$this
->assertTrue($media->field_media_in_library->value);
$this
->assertTrue($media
->getTranslation('hu')->field_media_in_library->value);
}