protected function ContextualDynamicContextTest::renderContextualLinks in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/contextual/src/Tests/ContextualDynamicContextTest.php \Drupal\contextual\Tests\ContextualDynamicContextTest::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.
1 call to ContextualDynamicContextTest::renderContextualLinks()
- ContextualDynamicContextTest::testDifferentPermissions in core/
modules/ contextual/ src/ Tests/ ContextualDynamicContextTest.php - Tests contextual links with different permissions.
File
- core/
modules/ contextual/ src/ Tests/ ContextualDynamicContextTest.php, line 185 - Contains \Drupal\contextual\Tests\ContextualDynamicContextTest.
Class
- ContextualDynamicContextTest
- Tests if contextual links are showing on the front page depending on permissions.
Namespace
Drupal\contextual\TestsCode
protected function renderContextualLinks($ids, $current_path) {
$post = array();
for ($i = 0; $i < count($ids); $i++) {
$post['ids[' . $i . ']'] = $ids[$i];
}
return $this
->drupalPostWithFormat('contextual/render', 'json', $post, array(
'query' => array(
'destination' => $current_path,
),
));
}