diff -u b/core/modules/picture/lib/Drupal/picture/Tests/PictureThemeFunctionsTest.php b/core/modules/picture/lib/Drupal/picture/Tests/PictureThemeFunctionsTest.php --- b/core/modules/picture/lib/Drupal/picture/Tests/PictureThemeFunctionsTest.php +++ b/core/modules/picture/lib/Drupal/picture/Tests/PictureThemeFunctionsTest.php @@ -57,7 +57,7 @@ $this->assertTrue(strpos($rendered_element, '') !== FALSE, 'picture element in theme_picture() correctly renders with a NULL value for the alt option.'); // Test using theme_picture() without passing a value for the alt option. - unset($element['alt']); + unset($element['#alt']); $rendered_element = render($element); $expected_result = ''; $this->assertTrue(strpos($rendered_element, $expected_result) !== FALSE, 'img element in theme_picture() correctly renders the alt option.');