@trigger_error('Usage of #item_attributes is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Use #attributes instead. See https://www.drupal.org/node/3554585',E_USER_DEPRECATED);
// Create the base element that we'll use in the tests below.
$path=$this->randomMachineName();
$element=[
'#theme'=>'image_formatter',
'#item'=>$entity->image_test,
'#url'=>Url::fromUri('base:'.$path),
'#item_attributes'=>[
'class'=>[
'foo',
],
],
];
$renderer->renderRoot($element);
$this->expectDeprecation('Usage of #item_attributes is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Use #attributes instead. See https://www.drupal.org/node/3554585');
@@ -42,7 +42,6 @@ public function theme() : array {
'variables'=>[
'attributes'=>[],
'item'=>NULL,
'item_attributes'=>NULL,
'url'=>NULL,
'responsive_image_style_id'=>NULL,
],
@@ -86,11 +85,6 @@ public function preprocessResponsiveImageFormatter(&$variables): void {
$attributes['title']=$item->title;
}
$attributes['alt']=$item->alt;
// Need to check that item_attributes has a value since it can be NULL.
if($variables['item_attributes']){
@trigger_error('Usage of #item_attributes is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Use #attributes instead. See https://www.drupal.org/node/3554585',E_USER_DEPRECATED);
$this->expectDeprecation('Usage of #item_attributes is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Use #attributes instead. See https://www.drupal.org/node/3554585');
}
/**
* Tests responsive image formatter on node display with one and two sources.