$this->
submitForm($edit, 'Add effect'
);
} } // Load the saved image style.
$style = ImageStyle::
load($style_name);
// Create an image for the 'public' wrapper.
$image_path =
$this->
createSampleImage($style, 'public'
);
// Expecting to find 2 images, one is the sample.png image shown in
// image style preview.
$this->
assertEquals(2,
$this->
getImageCount($style, 'public'
),
new FormattableMarkup('Image style %style image %file successfully generated.',
['%style' =>
$style->
label(), '%file' =>
$image_path]));
// Create an image for the 'private' wrapper.
$image_path =
$this->
createSampleImage($style, 'private'
);
$this->
assertEquals(1,
$this->
getImageCount($style, 'private'
),
new FormattableMarkup('Image style %style image %file successfully generated.',
['%style' =>
$style->
label(), '%file' =>
$image_path]));
// Remove the 'image_scale' effect and updates the style, which in turn
// forces an image style flush.
$style_path = 'admin/config/media/image-styles/manage/' .
$style->
id();
$uuids =
[];
foreach ($style->
getEffects() as $uuid =>
$effect) { $uuids[$effect->
getPluginId()] =
$uuid;
}