You are here

public function MockLanguageManager::setCurrentLanguage in Token 8

Sets the current language of the given type to use during tests.

Parameters

string $type: The language type.

\Drupal\Core\Language\LanguageInterface $language: The language.

File

tests/src/Kernel/MockLanguageManager.php, line 38

Class

MockLanguageManager
A language manager that can be easily overridden for testing purposes.

Namespace

Drupal\Tests\token\Kernel

Code

public function setCurrentLanguage($type, LanguageInterface $language) {
  $this->currentLanguages[$type] = $language;
}