protected function AdminUserLanguageUserTest::setUserAdminPreferredLang in Admin User Language 8
Parameters
string $langCode:
bool $preventOverride:
1 call to AdminUserLanguageUserTest::setUserAdminPreferredLang()
- AdminUserLanguageUserTest::testCoreFunctionalityOnUserRegistrationAndEdit in tests/
src/ Functional/ AdminUserLanguageUserTest.php - Test if an admin language is correctly set on user registration or edit.
File
- tests/
src/ Functional/ AdminUserLanguageUserTest.php, line 77
Class
- AdminUserLanguageUserTest
- Tests entity presave hook to check admin_user_language functionality.
Namespace
Drupal\Tests\admin_user_language\FunctionalCode
protected function setUserAdminPreferredLang($langCode, $preventOverride = FALSE) {
// Overriding configuration
$config = \Drupal::configFactory()
->getEditable('admin_user_language.settings');
$config
->set('default_language_to_assign', $langCode)
->set('prevent_user_override', $preventOverride)
->save();
}