// Assert strings from image module config are not available.
$string =
$this->storage->
findString(['source' => 'Medium (220×220)', 'context' => '', 'type' => 'configuration'
]);
$this->
assertNull($string, 'Configuration strings have been created upon installation.'
);
// Enable the image module.
$this->
drupalGet('admin/modules'
);
$this->
submitForm(['modules[image][enable]' => "1"
], 'Install'
);
$this->
rebuildContainer();
$string =
$this->storage->
findString(['source' => 'Medium (220×220)', 'context' => '', 'type' => 'configuration'
]);
$this->
assertNotEmpty($string, 'Configuration strings have been created upon installation.'
);
$locations =
$string->
getLocations();
// Check the configuration string has been created with the right location.
$this->
assertArrayHasKey('configuration',
$locations);
$this->
assertArrayHasKey('image.style.medium',
$locations['configuration'
]);
// Check the string is unique and has no translation yet.
$translations =
$this->storage->
getTranslations(['language' =>
$this->langcode, 'type' => 'configuration', 'name' => 'image.style.medium'
]);
$this->
assertCount(1,
$translations);
$translation =
reset($translations);
$this->
assertEquals($string->source,
$translation->source
);
$this->
assertEmpty($translation->translation
);