Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ProductListingCmsElementResolver example
private
ProductListingCmsElementResolver
$listingResolver
;
protected
function
setUp
(
)
: void
{
$mock
=
$this
->
createMock
(
ProductListingRoute::
class
)
;
$mock
->
method
(
'load'
)
->
willReturn
(
new
ProductListingRouteResponse
(
new
ProductListingResult
(
'product', 0,
new
ProductCollection
(
)
, null,
new
Criteria
(
)
, Context::
createDefaultContext
(
)
)
)
)
;
$this
->listingResolver =
new
ProductListingCmsElementResolver
(
$mock
)
;
}
public
function
testGetType
(
)
: void
{
static
::
assertEquals
(
'product-listing',
$this
->listingResolver->
getType
(
)
)
;
}
public
function
testCollect
(
)
: void
{
$resolverContext
=
new
ResolverContext
(
$this
->
createMock
(
SalesChannelContext::
class
)
,
new
Request
(
)
)
;