LanguageTestBase.php in Drupal 10
Same filename in this branch
Same filename and directory in other branches
Namespace
Drupal\Tests\language\KernelFile
core/modules/language/tests/src/Kernel/LanguageTestBase.phpView source
<?php
namespace Drupal\Tests\language\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* Test for dependency injected language object.
*/
abstract class LanguageTestBase extends KernelTestBase {
protected static $modules = [
'system',
'language',
'language_test',
];
/**
* The language manager.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* The state storage service.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this
->installConfig([
'language',
]);
$this->state = $this->container
->get('state');
// Ensure we are building a new Language object for each test.
$this->languageManager = $this->container
->get('language_manager');
$this->languageManager
->reset();
}
}
Classes
Name | Description |
---|---|
LanguageTestBase | Test for dependency injected language object. |