You are here

protected function TokenTreeTestTrait::assertTokenNotInTree in Token 8

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

Parameters

$token: The token name with the surrounding square brackets [].

string $parent: (optional) The parent CSS identifier of this token.

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

2 calls to TokenTreeTestTrait::assertTokenNotInTree()
TreeTest::testGlobalTokens in tests/src/Functional/Tree/TreeTest.php
Test various tokens that are possible on the site.
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 92

Class

TokenTreeTestTrait
Helper trait to assert tokens in token tree browser.

Namespace

Drupal\Tests\token\Functional\Tree

Code

protected function assertTokenNotInTree($token, $parent = '', $message = '') {
  $xpath = $this
    ->getXpathForTokenInTree($token, $parent);
  if (!$message) {
    $message = "Token {$token} not found.";
  }
  $this
    ->assertCount(0, $this
    ->xpath($xpath), $message);
}