$image_effect =
$this->
getMockBuilder('\Drupal\image\ImageEffectBase'
) ->
setConstructorArgs([[],
$image_effect_id,
[],
$logger]) ->
getMock();
$image_effect->
expects($this->
any()) ->
method('getDerivativeExtension'
) ->
willReturn('png'
);
$image_style =
$this->
getImageStyleMock($image_effect_id,
$image_effect);
$extensions =
['jpeg', 'gif', 'png'
];
foreach ($extensions as $extension) { $extensionReturned =
$image_style->
getDerivativeExtension($extension);
$this->
assertEquals('png',
$extensionReturned);
} } /**
* @covers ::buildUri
*/
public function testBuildUri() { // Image style that changes the extension.
$image_effect_id =
$this->
randomMachineName();
$logger =
$this->
getMockBuilder('\Psr\Log\LoggerInterface'
)->
getMock();