You are here

public function TreeTest::testAllTokens in Token 8

Test various tokens that are possible on the site.

File

tests/src/Functional/Tree/TreeTest.php, line 39

Class

TreeTest
Tests token tree page.

Namespace

Drupal\Tests\token\Functional\Tree

Code

public function testAllTokens() {
  $this
    ->drupalGet($this
    ->getTokenTreeUrl([
    'token_types' => 'all',
  ]));
  $this
    ->assertTokenGroup('Current date');
  $this
    ->assertTokenGroup('Site information');
  $this
    ->assertTokenInTree('[current-date:html_date]', 'current-date');
  $this
    ->assertTokenInTree('[current-date:html_week]', 'current-date');
  $this
    ->assertTokenInTree('[date:html_date]', 'date');
  $this
    ->assertTokenInTree('[date:html_week]', 'date');
  $this
    ->assertTokenInTree('[current-user:account-name]', 'current-user');
  $this
    ->assertTokenInTree('[user:account-name]', 'user');
  $this
    ->assertTokenInTree('[current-page:url:unaliased]', 'current-page--url');
  $this
    ->assertTokenInTree('[current-page:url:unaliased:args]', 'current-page--url--unaliased');
  $this
    ->assertTokenInTree('[user:original:account-name]', 'user--original');
}