TokenReplaceKernelTestBase.php

Same filename in other branches
  1. 9 core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTestBase.php
  2. 8.9.x core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTestBase.php
  3. 11.x core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTestBase.php

Namespace

Drupal\Tests\system\Kernel\Token

File

core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTestBase.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\system\Kernel\Token;

use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;

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

}

Classes

Title Deprecated Summary
TokenReplaceKernelTestBase Base class for token replacement tests.

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