class LanguageConfigOverrideInstallTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Kernel/LanguageConfigOverrideInstallTest.php \Drupal\Tests\language\Kernel\LanguageConfigOverrideInstallTest
- 9 core/modules/language/tests/src/Kernel/LanguageConfigOverrideInstallTest.php \Drupal\Tests\language\Kernel\LanguageConfigOverrideInstallTest
Ensures the language config overrides can be installed.
@group language
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\LanguageConfigOverrideInstallTest
Expanded class hierarchy of LanguageConfigOverrideInstallTest
File
- core/
modules/ language/ tests/ src/ Kernel/ LanguageConfigOverrideInstallTest.php, line 13
Namespace
Drupal\Tests\language\KernelView source
class LanguageConfigOverrideInstallTest extends KernelTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'language',
'config_events_test',
];
/**
* Tests the configuration events are not fired during install of overrides.
*/
public function testLanguageConfigOverrideInstall() {
ConfigurableLanguage::createFromLangcode('de')
->save();
// Need to enable test module after creating the language otherwise saving
// the language will install the configuration.
$this
->enableModules([
'language_config_override_test',
]);
\Drupal::state()
->set('config_events_test.event', FALSE);
$this
->installConfig([
'language_config_override_test',
]);
$event_recorder = \Drupal::state()
->get('config_events_test.event', FALSE);
$this
->assertFalse($event_recorder);
$config = \Drupal::service('language.config_factory_override')
->getOverride('de', 'language_config_override_test.settings');
$this
->assertEquals('Deutsch', $config
->get('name'));
}
}