diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageThemeFunctionTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageThemeFunctionTest.php index 6be3ee9..dc4228e 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageThemeFunctionTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageThemeFunctionTest.php @@ -102,6 +102,14 @@ function testImageFormatterTheme() { // Test using theme_image_formatter() without an image title, alt text, or // link options. + $element = array( + '#theme' => 'image_formatter', + '#image_style' => 'test', + '#item' => $entity->image_test, + '#path' => array( + 'path' => $path, + ), + ); $element['#item']->alt = ''; $this->drupalSetContent(render($element)); $elements = $this->xpath('//a[@href=:path]/img[@class="image-style-test" and @src=:url and @width=:width and @height=:height and @alt=""]', array(':path' => base_path() . $path, ':url' => $url, ':width' => $image->getWidth(), ':height' => $image->getHeight())); @@ -109,10 +117,17 @@ function testImageFormatterTheme() { // Link the image to a fragment on the page, and not a full URL. $fragment = $this->randomName(); - $element['#path']['path'] = ''; - $element['#path']['options'] = array( - 'external' => TRUE, - 'fragment' => $fragment, + $element = array( + '#theme' => 'image_formatter', + '#image_style' => 'test', + '#item' => $entity->image_test, + '#path' => array( + 'path' => '', + 'options' => array( + 'external' => TRUE, + 'fragment' => $fragment, + ), + ), ); $this->drupalSetContent(render($element)); $elements = $this->xpath('//a[@href=:fragment]/img[@class="image-style-test" and @src=:url and @width=:width and @height=:height and @alt=""]', array(':fragment' => '#' . $fragment, ':url' => $url, ':width' => $image->getWidth(), ':height' => $image->getHeight()));