// These are added by a hook_image_style_presave() implemented in
// image_module_test module.
$this->
assertEquals('bar',
$style->
getThirdPartySetting('image_module_test', 'foo'
), 'Third party settings were added to the image style.'
);
// Ensure that the image style URI matches our expected path.
$style_uri_path =
$style->
toUrl()->
toString();
$this->
assertStringContainsString($style_path,
$style_uri_path, 'The image style URI is correct.'
);
// Confirm that all effects on the image style have settings that match
// what was saved.
$uuids =
[];
foreach ($style->
getEffects() as $uuid =>
$effect) { // Store the uuid for later use.
$uuids[$effect->
getPluginId()] =
$uuid;
$effect_configuration =
$effect->
getConfiguration();
foreach ($effect_edits[$effect->
getPluginId()] as $field =>
$value) { $this->
assertEquals($effect_configuration['data'
][$field],
$value,
new FormattableMarkup('The %field field in the %effect effect has the correct value of %value.',
['%field' =>
$field, '%effect' =>
$effect->
getPluginId(), '%value' =>
$value]));
} } // Assert that every effect was saved.
foreach (array_keys($effect_edits) as $effect_name) { $this->
assertTrue(isset($uuids[$effect_name]),
new FormattableMarkup(