You are here

protected function TokenTreeTestTrait::assertTokenGroup in Token 8

Check to see if the specified token group is present in the token browser.

Parameters

string $token_group: The name of the token group.

string $message: (optional) A message to display with the assertion.

5 calls to TokenTreeTestTrait::assertTokenGroup()
HelpPageTest::testHelpPageTree in tests/src/Functional/Tree/HelpPageTest.php
Tests the token browser on the token help page.
TreeTest::testAllTokens in tests/src/Functional/Tree/TreeTest.php
Test various tokens that are possible on the site.
TreeTest::testGlobalTokens in tests/src/Functional/Tree/TreeTest.php
Test various tokens that are possible on the site.
TreeTest::testNodeTokens in tests/src/Functional/Tree/TreeTest.php
Tests if the token browser displays the node tokens.
TreeTest::testUserTokens in tests/src/Functional/Tree/TreeTest.php
Tests if the token browser displays the user tokens.

File

tests/src/Functional/Tree/TokenTreeTestTrait.php, line 33

Class

TokenTreeTestTrait
Helper trait to assert tokens in token tree browser.

Namespace

Drupal\Tests\token\Functional\Tree

Code

protected function assertTokenGroup($token_group, $message = '') {
  $groups = $this
    ->getTokenGroups();
  if (!$message) {
    $message = "Token group {$token_group} found.";
  }
  $this
    ->assertContains($token_group, $groups, $message);
}