public function LibraryInclusionTranslationTest::test in Lightning Media 8.3
Same name in this branch
- 8.3 modules/lightning_media_image/tests/src/Kernel/LibraryInclusionTranslationTest.php \Drupal\Tests\lightning_media_image\Kernel\LibraryInclusionTranslationTest::test()
- 8.3 modules/lightning_media_audio/tests/src/Kernel/LibraryInclusionTranslationTest.php \Drupal\Tests\lightning_media_audio\Kernel\LibraryInclusionTranslationTest::test()
- 8.3 modules/lightning_media_instagram/tests/src/Functional/LibraryInclusionTranslationTest.php \Drupal\Tests\lightning_media_instagram\Functional\LibraryInclusionTranslationTest::test()
- 8.3 modules/lightning_media_twitter/tests/src/Kernel/LibraryInclusionTranslationTest.php \Drupal\Tests\lightning_media_twitter\Kernel\LibraryInclusionTranslationTest::test()
Same name and namespace in other branches
- 8.4 modules/lightning_media_twitter/tests/src/Kernel/LibraryInclusionTranslationTest.php \Drupal\Tests\lightning_media_twitter\Kernel\LibraryInclusionTranslationTest::test()
File
- modules/
lightning_media_twitter/ tests/ src/ Kernel/ LibraryInclusionTranslationTest.php, line 34
Class
- LibraryInclusionTranslationTest
- @group lightning_media @group lightning_media_twitter
Namespace
Drupal\Tests\lightning_media_twitter\KernelCode
public function test() {
$media = Media::create([
'bundle' => 'tweet',
'name' => $this
->randomString(),
'embed_code' => 'https://twitter.com/PhenaProxima/status/1158431969920901126',
'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);
}