'node:node=' .
$node1->
id() . ':changed=' .
$node1->
getChangedTime() . '&langcode=en',
'node:node=' .
$node2->
id() . ':changed=' .
$node2->
getChangedTime() . '&langcode=en',
'node:node=' .
$node3->
id() . ':changed=' .
$node3->
getChangedTime() . '&langcode=en',
'entity.view.edit_form:view=frontpage:location=page&name=frontpage&display_id=page_1&langcode=en',
];
// Editor user: can access contextual links and can edit articles.
$this->
drupalGet('node'
);
for ($i = 0;
$i <
count($ids);
$i++
) { $this->
assertContextualLinkPlaceHolder($ids[$i]);
} $response =
$this->
renderContextualLinks([], 'node'
);
$this->
assertSame(400,
$response->
getStatusCode());
$this->
assertStringContainsString('No contextual ids specified.',
(string) $response->
getBody());
$response =
$this->
renderContextualLinks($ids, 'node'
);
$this->
assertSame(200,
$response->
getStatusCode());
$json = Json::
decode((string) $response->
getBody());
$this->
assertSame('<ul class="contextual-links"><li><a href="' .
base_path() . 'node/1/edit">Edit</a></li></ul>',
$json[$ids[0
]]);
$this->
assertSame('',
$json[$ids[1
]]);
$this->
assertSame('<ul class="contextual-links"><li><a href="' .
base_path() . 'node/3/edit">Edit</a></li></ul>',
$json[$ids[2
]]);
$this->
assertSame('',
$json[$ids[3
]]);
// Verify that link language is properly handled.