Tests the view of the system site.
public function testSystemSite() {
$this
->installConfig([
'system',
]);
$this
->config('system.site')
->set('slogan', 'Test slogan')
->save();
$job = tmgmt_job_create('en', 'de');
$job->translator = 'test_translator';
$job
->save();
$job_item = tmgmt_job_item_create('config', '_simple_config', 'system.site_information_settings', array(
'tjid' => $job
->id(),
));
$job_item
->save();
$source_plugin = $this->container
->get('plugin.manager.tmgmt.source')
->createInstance('config');
$data = $source_plugin
->getData($job_item);
// Test the name property.
$this
->assertEquals('Slogan', $data['slogan']['#label']);
$this
->assertEquals('Test slogan', $data['slogan']['#text']);
$this
->assertTrue($data['slogan']['#translate']);
// Test item types.
$this
->assertEquals('View', $source_plugin
->getItemTypes()['view']);
// Now request a translation and save it back.
$job
->requestTranslation();
$items = $job
->getItems();
$item = reset($items);
$item
->acceptTranslation();
$data = $item
->getData();
// Check that the translations were saved correctly.
$language_manager = \Drupal::languageManager();
$language_manager
->setConfigOverrideLanguage($language_manager
->getLanguage('de'));
$this
->assertEquals($data['slogan']['#translation']['#text'], \Drupal::config('system.site')
->get('slogan'));
}