class TokenReplaceKernelTestBase

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTestBase.php \Drupal\Tests\system\Kernel\Token\TokenReplaceKernelTestBase

Base class for token replacement tests.

Hierarchy

Expanded class hierarchy of TokenReplaceKernelTestBase

1 file declares its use of TokenReplaceKernelTestBase
NodeTokenReplaceTest.php in core/modules/node/tests/src/Kernel/NodeTokenReplaceTest.php

File

core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTestBase.php, line 10

Namespace

Drupal\Tests\system\Kernel\Token
View source
abstract class TokenReplaceKernelTestBase extends EntityKernelTestBase {
  
  /**
   * The interface language.
   *
   * @var \Drupal\Core\Language\LanguageInterface
   */
  protected $interfaceLanguage;
  
  /**
   * Token service.
   *
   * @var \Drupal\Core\Utility\Token
   */
  protected $tokenService;
  
  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = [
    'system',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    // Install default system configuration.
    $this->installConfig([
      'system',
    ]);
    $this->interfaceLanguage = \Drupal::languageManager()->getCurrentLanguage();
    $this->tokenService = \Drupal::token();
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.