public function MediaImageTest::testCkeditorWidgetWorksForAllEmbeds in Entity Embed 8
Tests even <drupal-entity> elements whose button is not present are upcast.
@dataProvider providerCkeditorWidgetWorksForAllEmbeds
Parameters
string $data_embed_button_attribute: The HTML for a data-embed-button atttribute.
File
- tests/
src/ FunctionalJavascript/ MediaImageTest.php, line 781
Class
- MediaImageTest
- Test Media Image specific functionality.
Namespace
Drupal\Tests\entity_embed\FunctionalJavascriptCode
public function testCkeditorWidgetWorksForAllEmbeds($data_embed_button_attribute) {
$this->host->body->value = '<drupal-entity data-caption="baz" ' . $data_embed_button_attribute . ' data-entity-embed-display="entity_reference:media_thumbnail" data-entity-embed-display-settings="{"image_style":"","image_link":""}" data-entity-type="media" data-entity-uuid="' . $this->media
->uuid() . '"></drupal-entity>';
$this->host
->save();
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('node/' . $this->host
->id() . '/edit');
$this
->waitForEditor();
$this
->assignNameToCkeditorIframe();
$this
->getSession()
->switchToIFrame('ckeditor');
$this
->assertNotNull($this
->assertSession()
->waitForElementVisible('css', 'figcaption'));
}