You are here

public function EntityEmbedFilterTest::testOnlyDrupalEntityTagProcessed in Entity Embed 8

Tests that only <drupal-entity> tags are processed.

See also

\Drupal\Tests\entity_embed\FunctionalJavascript\MediaImageTest::testOnlyDrupalEntityTagProcessed()

File

tests/src/Kernel/EntityEmbedFilterTest.php, line 297

Class

EntityEmbedFilterTest
@coversDefaultClass \Drupal\entity_embed\Plugin\Filter\EntityEmbedFilter @group entity_embed

Namespace

Drupal\Tests\entity_embed\Kernel

Code

public function testOnlyDrupalEntityTagProcessed() {
  $content = $this
    ->createEmbedCode([
    'data-entity-type' => 'node',
    'data-entity-uuid' => $this->embeddedEntity
      ->uuid(),
    'data-view-mode' => 'teaser',
  ]);
  $content = str_replace('drupal-entity', 'entity-embed', $content);
  $filter_result = $this
    ->processText($content, 'en', [
    'entity_embed',
  ]);

  // If input equals output, the filter didn't change anything.
  $this
    ->assertSame($content, $filter_result
    ->getProcessedText());
}