function MediaEmbedFilterTest::testMissingEntityIndicator
Same name in other branches
- 9 core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php \Drupal\Tests\media\Kernel\MediaEmbedFilterTest::testMissingEntityIndicator()
- 8.9.x core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php \Drupal\Tests\media\Kernel\MediaEmbedFilterTest::testMissingEntityIndicator()
- 10 core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php \Drupal\Tests\media\Kernel\MediaEmbedFilterTest::testMissingEntityIndicator()
Tests the indicator for missing entities.
@dataProvider providerMissingEntityIndicator
File
-
core/
modules/ media/ tests/ src/ Kernel/ MediaEmbedFilterTest.php, line 283
Class
- MediaEmbedFilterTest
- @coversDefaultClass \Drupal\media\Plugin\Filter\MediaEmbed @group media
Namespace
Drupal\Tests\media\KernelCode
public function testMissingEntityIndicator($uuid, array $filter_ids, array $additional_attributes) : void {
$content = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => $uuid,
'data-view-mode' => 'foobar',
] + $additional_attributes);
// If the UUID being used in the embed is that of the sample entity, first
// assert that it currently results in a functional embed, then delete it.
if ($uuid === static::EMBEDDED_ENTITY_UUID) {
$result = $this->processText($content, 'en', $filter_ids);
$this->setRawContent($result->getProcessedText());
$this->assertCount(1, $this->cssSelect('div[data-media-embed-test-view-mode="foobar"]'));
$this->embeddedEntity
->delete();
}
$result = $this->processText($content, 'en', $filter_ids);
$this->setRawContent($result->getProcessedText());
$this->assertCount(0, $this->cssSelect('div[data-media-embed-test-view-mode="foobar"]'));
$this->assertCount(1, $this->cssSelect('div.this-error-message-is-themeable'));
if (in_array('filter_align', $filter_ids, TRUE) && !empty($additional_attributes['data-align'])) {
$this->assertCount(1, $this->cssSelect('div.align-' . $additional_attributes['data-align']));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.