You are here

public function EntityEmbedFilterLegacyTest::testEntityEmbedSettingsBackwardsCompatibility in Entity Embed 8

Tests BC for `data-entity-embed-display-settings`'s predecessor.

File

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

Class

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

Namespace

Drupal\Tests\entity_embed\Kernel

Code

public function testEntityEmbedSettingsBackwardsCompatibility() {
  $content = $this
    ->createEmbedCode([
    'data-entity-type' => 'node',
    'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
    'data-entity-embed-display' => 'entity_reference:entity_reference_label',
    'data-entity-embed-settings' => '{"link":"0"}',
  ]);
  $this
    ->applyFilter($content);
  $this
    ->assertCount(0, $this
    ->cssSelect('div.embedded-entity a'));
  $this
    ->assertSame($this->embeddedEntity
    ->label(), (string) $this
    ->cssSelect('div.embedded-entity')[0]);
}