'languages:language_interface',
'theme',
'url.query_args',
];
$this->
assertCacheContexts($expected_contexts);
// Clicking a click sort should change the order.
$this->
clickLink('ID'
);
$href = Url::
fromRoute('<none>',
[],
['query' =>
['order' => 'id', 'sort' => 'desc'
]])->
toString();
$this->
assertSession()->
linkByHrefExists($href);
// Check that the output has the expected order (asc).
$ids =
$this->
clickSortLoadIdsFromOutput();
$this->
assertEquals(range(1, 5
),
$ids);
// Check that the rel attribute has the correct value.
$this->
assertSession()->
elementAttributeContains('xpath', "//a[@href='
$href']", 'rel', 'nofollow'
);
$this->
clickLink('ID Sort descending'
);
// Check that the output has the expected order (desc).
$ids =
$this->
clickSortLoadIdsFromOutput();
$this->
assertEquals(range(5, 1, -1
),
$ids);
} /**
* Tests the default click sorting functionality with distinct.
*/