$this->
drupalGet($style_path . '/effects/' .
$uuids['image_crop'
] . '/delete'
);
$this->
submitForm([], 'Delete'
);
// Confirm that the form submission was successful.
$this->
assertSession()->
statusCodeEquals(200
);
$image_crop_effect =
$style->
getEffect($uuids['image_crop'
]);
$this->
assertSession()->
statusMessageContains("The image effect {
$image_crop_effect->
label()} has been deleted.", 'status'
);
// Confirm that there is no longer a link to the effect.
$this->
assertSession()->
linkByHrefNotExists($style_path . '/effects/' .
$uuids['image_crop'
] . '/delete'
);
// Refresh the image style information and verify that the effect was
// actually deleted.
$entity_type_manager =
$this->container->
get('entity_type.manager'
);
$style =
$entity_type_manager->
getStorage('image_style'
)->
loadUnchanged($style->
id());
$this->
assertFalse($style->
getEffects()->
has($uuids['image_crop'
]),
new FormattableMarkup( 'Effect with ID %uuid no longer found on image style %style',
[ '%uuid' =>
$uuids['image_crop'
],
'%style' =>
$style->
label(),
]));
// Additional test on Rotate effect, for transparent background.
$edit =
[ 'data[degrees]' => 5,
'data[random]' => 0,