protected function TokenTreeTestTrait::getTokenGroups in Token 8
Get an array of token groups from the last retrieved page.
Return value
array Array of token group names.
2 calls to TokenTreeTestTrait::getTokenGroups()
- TokenTreeTestTrait::assertTokenGroup in tests/
src/ Functional/ Tree/ TokenTreeTestTrait.php - Check to see if the specified token group is present in the token browser.
- TokenTreeTestTrait::assertTokenNotGroup in tests/
src/ Functional/ Tree/ TokenTreeTestTrait.php - Check to see if the specified token group is not present in the token browser.
File
- tests/
src/ Functional/ Tree/ TokenTreeTestTrait.php, line 18
Class
- TokenTreeTestTrait
- Helper trait to assert tokens in token tree browser.
Namespace
Drupal\Tests\token\Functional\TreeCode
protected function getTokenGroups() {
$groups = $this
->xpath('//tr[contains(@class, "token-group")]/td[1]');
return array_map(function (NodeElement $item) {
return (string) $item
->getText();
}, $groups);
}