public function EmbeddedMediaLabelTest::testEmbeddedMediaItem in Lightning Media 8
Same name and namespace in other branches
- 8.4 tests/src/Functional/EmbeddedMediaLabelTest.php \Drupal\Tests\lightning_media\Functional\EmbeddedMediaLabelTest::testEmbeddedMediaItem()
- 8.2 tests/src/Functional/EmbeddedMediaLabelTest.php \Drupal\Tests\lightning_media\Functional\EmbeddedMediaLabelTest::testEmbeddedMediaItem()
- 8.3 tests/src/Functional/EmbeddedMediaLabelTest.php \Drupal\Tests\lightning_media\Functional\EmbeddedMediaLabelTest::testEmbeddedMediaItem()
Tests that the label of an embedded media item does not appear in the rendered host entity.
File
- tests/
src/ Functional/ EmbeddedMediaLabelTest.php, line 42
Class
- EmbeddedMediaLabelTest
- @group lightning @group lightning_media
Namespace
Drupal\Tests\lightning_media\FunctionalCode
public function testEmbeddedMediaItem() {
$media = Media::create([
'bundle' => 'tweet',
'name' => 'Here be dragons',
'embed_code' => 'https://twitter.com/50NerdsofGrey/status/757319527151636480',
]);
$media
->setPublished();
$media
->save();
$node = Node::create([
'type' => $this->nodeType,
'body' => '<drupal-entity data-embed-button="media_browser" data-entity-embed-display="view_mode:media.embedded" data-entity-type="media" data-entity-uuid="' . $media
->uuid() . '"></drupal-entity>',
'title' => $this
->getRandomGenerator()
->word(16),
]);
$node
->setPublished();
$node
->save();
$this
->drupalGet($node
->toUrl());
$this
->assertSession()
->pageTextNotContains($media
->label());
}