/**
* @internal
*
* @covers \Shopware\Core\Content\Media\Pathname\UrlGenerator
*/
#[Package('buyers-experience')]
class UrlGeneratorTest extends TestCase
{ public function testAbsoluteMediaUrl(): void
{ $mediaEntity =
new MediaEntity();
$mediaEntity->
assign( [ 'id' => Uuid::
randomHex(),
'fileName' => 'file.jpg',
] );
$urlGenerator =
new UrlGenerator(new FilenamePathnameStrategy(),
new Filesystem(new InMemoryFilesystemAdapter(),
['public_url' => 'http://localhost:8000'
]));
static::
assertSame( 'http://localhost:8000/media/d0/b3/24/file.jpg',
$urlGenerator->
getAbsoluteMediaUrl($mediaEntity) );
}