'url' => 'https://shopware.test/foo/bar/media.png',
'private' => false,
'mediaType' => 'image/png',
'translations' =>
[ 'DEFAULT' =>
$mediaTranslations,
],
];
$mapping =
$this->
getDefaultMapping(MediaDefinition::ENTITY_NAME
);
$config =
new Config($mapping,
[],
[]);
$mappingPipe =
new KeyMappingPipe($mapping, true
);
$pipeInResult =
$mappingPipe->
in($config,
$media);
static::
assertInstanceOf(\Traversable::
class,
$pipeInResult);
$mappedMedia =
iterator_to_array($pipeInResult);
static::
assertSame($media['id'
],
$mappedMedia['id'
]);
static::
assertSame($media['mediaFolderId'
],
$mappedMedia['folder_id'
]);
static::
assertSame($media['url'
],
$mappedMedia['url'
]);
static::
assertSame($media['private'
],
$mappedMedia['private'
]);
static::
assertSame($media['mediaType'
],
$mappedMedia['type'
]);
static::
assertSame($mediaTranslations['alt'
],
$mappedMedia['alt'
]);