You are here

protected function ConfigTranslationUiTest::renderContextualLinks in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationUiTest::renderContextualLinks()
  2. 10 core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationUiTest::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

core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php, line 1173

Class

ConfigTranslationUiTest
Translate settings and entities to various languages.

Namespace

Drupal\Tests\config_translation\Functional

Code

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