You are here

protected function JuiceboxCaseTestBase::renderContextualLinks in Juicebox HTML5 Responsive Image Galleries 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/JuiceboxCaseTestBase.php \Drupal\Tests\juicebox\Functional\JuiceboxCaseTestBase::renderContextualLinks()

Get server-rendered contextual links for the given contextual link ids.

Parameters

array $ids: An array of contextual link ids.

string $current_path: The Drupal path for the page for which the contextual links are rendered.

Return value

string The response body.

File

tests/src/Functional/JuiceboxCaseTestBase.php, line 173

Class

JuiceboxCaseTestBase
Common helper class for Juicebox module tests.

Namespace

Drupal\Tests\juicebox\Functional

Code

protected function renderContextualLinks(array $ids, $current_path) {
  $post = [];
  for ($i = 0; $i < count($ids); $i++) {
    $post['ids[' . $i . ']'] = $ids[$i];
  }
  return $this
    ->drupalPost('contextual/render', 'application/json', $post, [
    'query' => [
      'destination' => $current_path,
    ],
  ]);
}