You are here

public function UnitTest::testContentEntityOnlyTokens in Token 8

Test that tokens are generated only for content entities.

File

tests/src/Kernel/UnitTest.php, line 113

Class

UnitTest
Test basic, low-level token functions.

Namespace

Drupal\Tests\token\Kernel

Code

public function testContentEntityOnlyTokens() {

  // Verify that type and token info for a config entity is not generated.
  $this
    ->assertNull($this->tokenService
    ->getTokenInfo('user_role', 'original'));
  $this
    ->assertNull($this->tokenService
    ->getTokenInfo('user_role', 'url'));
  $this
    ->assertNull($this->tokenService
    ->getTypeInfo('user_role'));
}