$this->
assertFalse($translation_after->
isNew());
$translation_after->
setString('updated_translation'
)->
save();
} /**
* Tests getDefaultConfigLangcode().
*/
public function testGetDefaultConfigLangcode() { // Install the Language module's configuration so we can use the
// module_installer service.
$this->
installConfig(['language'
]);
$this->
assertNull(\Drupal::
service('locale.config_manager'
)->
getDefaultConfigLangcode('locale_test_translate.settings'
), 'Before installing a module the locale config manager can not access the shipped configuration.'
);
\Drupal::
service('module_installer'
)->
install(['locale_test_translate'
]);
$this->
assertEquals('en', \Drupal::
service('locale.config_manager'
)->
getDefaultConfigLangcode('locale_test_translate.settings'
), 'After installing a module the locale config manager can get the shipped configuration langcode.'
);
$simple_config = \Drupal::
configFactory()->
getEditable('locale_test_translate.simple_config_extra'
);
$simple_config->
set('foo', 'bar'
)->
save();
$this->
assertNull(\Drupal::
service('locale.config_manager'
)->
getDefaultConfigLangcode($simple_config->
getName()), 'Simple config created through the API is not treated as shipped configuration.'
);
$block = Block::
create([ 'id' => 'test_default_config',
'theme' => 'stark',
'status' => TRUE,