You are here

TokenReplaceUnitTestBase.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php

File

core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php
View source
<?php

/**
 * @file
 * Contains \Drupal\system\Tests\System\TokenReplaceUnitTestBase.
 */
namespace Drupal\system\Tests\System;

use Drupal\system\Tests\Entity\EntityUnitTestBase;

/**
 * Base class for token replacement tests.
 */
abstract class TokenReplaceUnitTestBase extends EntityUnitTestBase {

  /**
   * The interface language.
   *
   * @var \Drupal\Core\Language\LanguageInterface
   */
  protected $interfaceLanguage;

  /**
   * Token service.
   *
   * @var \Drupal\Core\Utility\Token
   */
  protected $tokenService;

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = array(
    'system',
  );
  protected function setUp() {
    parent::setUp();

    // Install default system configuration.
    $this
      ->installConfig(array(
      'system',
    ));
    $this
      ->installSchema('system', array(
      'router',
    ));
    \Drupal::service('router.builder')
      ->rebuild();
    $this->interfaceLanguage = \Drupal::languageManager()
      ->getCurrentLanguage();
    $this->tokenService = \Drupal::token();
  }

}

Classes

Namesort descending Description
TokenReplaceUnitTestBase Base class for token replacement tests.