Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getEntitySearchResult example
$this
->imageSliderResolver->
enrich
(
$slot
,
$resolverContext
,
$result
)
;
$imageSliderStruct
=
$slot
->
getData
(
)
;
static
::
assertInstanceOf
(
ImageSliderStruct::
class
,
$imageSliderStruct
)
;
static
::
assertEmpty
(
$imageSliderStruct
->
getSliderItems
(
)
)
;
}
public
function
testEnrichWithMappedConfigAndHasCorrectOrder
(
)
: void
{
$productMediaCollection
=
$this
->
getProductMediaCollection
(
)
;
$resolverContext
=
$this
->
getResolverContext
(
$productMediaCollection
)
;
$result
=
$this
->
getEntitySearchResult
(
$productMediaCollection
,
$resolverContext
)
;
$fieldConfig
=
new
FieldConfigCollection
(
)
;
$fieldConfig
->
add
(
new
FieldConfig
(
'sliderItems', FieldConfig::SOURCE_MAPPED, 'product.media'
)
)
;
$slot
=
new
CmsSlotEntity
(
)
;
$slot
->
setUniqueIdentifier
(
'id'
)
;
$slot
->
setType
(
'image-slider'
)
;
$slot
->
setFieldConfig
(
$fieldConfig
)
;
$this
->imageSliderResolver->
enrich
(
$slot
,
$resolverContext
,
$result
)
;