You are here

public function EntityEmbedFilterLegacyTest::testEntityIdBackwardsCompatibility in Entity Embed 8

Tests BC for `data-entity-uuid`'s predecessor, `data-entity-id`.

File

tests/src/Kernel/EntityEmbedFilterLegacyTest.php, line 24

Class

EntityEmbedFilterLegacyTest
@coversDefaultClass \Drupal\entity_embed\Plugin\Filter\EntityEmbedFilter @group entity_embed @group legacy

Namespace

Drupal\Tests\entity_embed\Kernel

Code

public function testEntityIdBackwardsCompatibility() {
  $content = $this
    ->createEmbedCode([
    'data-entity-type' => 'node',
    'data-entity-id' => 1,
    'data-view-mode' => 'teaser',
  ]);
  $this
    ->applyFilter($content);
  $this
    ->assertHasAttributes($this
    ->cssSelect('div.embedded-entity')[0], [
    'data-entity-type' => 'node',
    'data-entity-id' => 1,
    'data-view-mode' => 'teaser',
    'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
    'data-langcode' => 'en',
    'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view',
    'data-entity-embed-display-settings' => 'teaser',
  ]);
}