$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;
} $this->
drupalGet($style_path . '/effects/' .
$uuids['image_scale'
] . '/delete'
);
$this->
submitForm([], 'Delete'
);
$this->
assertSession()->
statusCodeEquals(200
);
$this->
drupalGet($style_path);
$this->
submitForm([], 'Save'
);
$this->
assertSession()->
statusCodeEquals(200
);
// Post flush, expected 1 image in the 'public' wrapper (sample.png).
$this->
assertEquals(1,
$this->
getImageCount($style, 'public'
),
new FormattableMarkup('Image style %style flushed correctly for %wrapper wrapper.',
['%style' =>
$style->
label(), '%wrapper' => 'public'
]));