abstract class LanguageTestBase in Drupal 10
Same name in this branch
- 10 core/modules/language/tests/src/Kernel/LanguageTestBase.php \Drupal\Tests\language\Kernel\LanguageTestBase
- 10 core/modules/language/tests/src/Kernel/Views/LanguageTestBase.php \Drupal\Tests\language\Kernel\Views\LanguageTestBase
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Kernel/LanguageTestBase.php \Drupal\Tests\language\Kernel\LanguageTestBase
- 9 core/modules/language/tests/src/Kernel/LanguageTestBase.php \Drupal\Tests\language\Kernel\LanguageTestBase
Test for dependency injected language object.
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, AssertContentTrait, ConfigTestTrait, ExtensionListTestTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings
- class \Drupal\Tests\language\Kernel\LanguageTestBase
Expanded class hierarchy of LanguageTestBase
File
- core/
modules/ language/ tests/ src/ Kernel/ LanguageTestBase.php, line 10
Namespace
Drupal\Tests\language\KernelView source
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();
}
}