You are here

public function PreviewTest::getRoute in Embed 8

Performs a request to the embed.preview route.

Parameters

string $filter_format_id: ID of the filter format.

string $value: The query string value to include.

Return value

string The retrieved HTML string.

1 call to PreviewTest::getRoute()
PreviewTest::testPreviewRoute in tests/src/Functional/PreviewTest.php
Tests the route used for generating preview of embedding entities.

File

tests/src/Functional/PreviewTest.php, line 63

Class

PreviewTest
Tests the preview controller and route.

Namespace

Drupal\Tests\embed\Functional

Code

public function getRoute($filter_format_id, $value = NULL) {
  $url = 'embed/preview/' . $filter_format_id;
  if (!isset($value)) {
    $value = static::SUCCESS;
  }
  return $this
    ->drupalGet($url, [
    'query' => [
      'text' => $value,
    ],
  ]);
}