TokenReplaceUnitTestBase.php 932 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php

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

namespace Drupal\system\Tests\System;

use Drupal\Core\Language\Language;
use Drupal\system\Tests\Entity\EntityUnitTestBase;

/**
14
 * Base class for token replacement tests.
15
 */
16
abstract class TokenReplaceUnitTestBase extends EntityUnitTestBase {
17 18 19 20 21 22

  /**
   * The interface language.
   *
   * @var \Drupal\Core\Language\Language
   */
23
  protected $interfaceLanguage;
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

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

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = array('system');

  public function setUp() {
    parent::setUp();
    // Install default system configuration.
    $this->installConfig(array('system'));

44
    $this->interfaceLanguage = \Drupal::languageManager()->getCurrentLanguage();
45 46 47 48
    $this->tokenService = \Drupal::token();
  }

}