/**
* Test the cacheability of the linkset endpoint.
*
* This test's purpose is to ensure that the menu linkset response is properly
* cached. It does this by sending a request and validating it has a cache
* miss and the correct cacheability meta, then by sending the same request to
* assert a cache hit. Finally, a new menu item is created to ensure that the
* cached response is properly invalidated.
*/
public function testCacheability() { $this->
enableEndpoint(TRUE
);
$expected_cacheability =
new CacheableMetadata();
$expected_cacheability->
addCacheContexts([ 'user.permissions',
]);
$expected_cacheability->
addCacheTags([ 'config:system.menu.main',
'config:user.role.anonymous',
'http_response',
'node:1',
'node:2',
'node:3',
]);