$packages =
$this->
getContainer()->
get('assets.packages'
);
$translator =
$this->
createConfiguredMock( Translator::
class,
[ 'trans' => 'foobar',
] );
$this->decorated =
$this->
createMock(AbstractDefaultMediaResolver::
class);
$this->mediaResolver =
new DefaultMediaResolver($this->decorated,
$translator,
$packages);
} public function testGetDefaultMediaEntityWithoutValidFileName(): void
{ $this->decorated->
method('getDefaultCmsMediaEntity'
)->
willReturn(null
);
$media =
$this->mediaResolver->
getDefaultCmsMediaEntity('this/file/does/not/exists'
);
static::
assertNull($media);
} public function testGetDefaultMediaEntityWithValidFileName(): void
{