Skip to content

Commit

Permalink
Revert a BC-break introduced by 22b20c5 (#1113)
Browse files Browse the repository at this point in the history
Reverting a BC-break is a BC-break, but I demand that this gets merged
anyway.
Fixes #1065
  • Loading branch information
greg0ire authored and OskarStark committed Sep 7, 2016
1 parent c05ad39 commit 27cde76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions Tests/Twig/Extension/MediaExtensionTest.php
Expand Up @@ -41,7 +41,7 @@ class MediaExtensionTest extends \PHPUnit_Framework_TestCase
*/
private $media;

public function testThumbnailCanRenderHtmlAttributesGivenByTheProvider()
public function testThumbnailHasAllNecessaryAttributes()
{
$mediaExtension = new MediaExtension($this->getMediaService(), $this->getMediaManager());
$mediaExtension->initRuntime($this->getEnvironment());
Expand All @@ -54,12 +54,8 @@ public function testThumbnailCanRenderHtmlAttributesGivenByTheProvider()
);

$provider = $this->getProvider();
$provider->expects($this->once())->method('getHelperProperties')->with($media, $format, $options)
->willReturn(array(
'title' => 'Test title',
'alt' => 'Test title',
'data-custom' => 'foo',
));
$provider->expects($this->once())->method('generatePublicUrl')->with($media, $format)
->willReturn('http://some.url.com');

$template = $this->getTemplate();
$template->expects($this->once())
Expand All @@ -71,7 +67,7 @@ public function testThumbnailCanRenderHtmlAttributesGivenByTheProvider()
'options' => array(
'title' => 'Test title',
'alt' => 'Test title',
'data-custom' => 'foo',
'src' => 'http://some.url.com',
),
)
)
Expand Down
2 changes: 1 addition & 1 deletion Twig/Extension/MediaExtension.php
Expand Up @@ -146,7 +146,7 @@ public function thumbnail($media, $format, $options = array())

$options = array_merge($defaultOptions, $options);

$options = $provider->getHelperProperties($media, $format, $options);
$options['src'] = $provider->generatePublicUrl($media, $format);

return $this->render($provider->getTemplate('helper_thumbnail'), array(
'media' => $media,
Expand Down

0 comments on commit 27cde76

Please sign in to comment.