Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
page example
$this
->
createMock
(
ProductReviewLoader::
class
)
,
$this
->
createMock
(
FindProductVariantRoute::
class
)
,
$eventDispatcherMock
)
;
}
public
function
testPageNoId
(
)
: void
{
$this
->
expectException
(
RoutingException::
class
)
;
$this
->
expectExceptionMessage
(
'Parameter "id" is missing.'
)
;
$this
->controller->
page
(
null,
new
Request
(
)
,
$this
->
createMock
(
SalesChannelContext::
class
)
)
;
}
public
function
testPageReturn
(
)
: void
{
$cmsRouteResponse
=
new
CmsRouteResponse
(
new
CmsPageEntity
(
)
)
;
$this
->cmsRouteMock->
method
(
'load'
)
->
willReturn
(
$cmsRouteResponse
)
;
$ids
=
new
IdsCollection
(
)
;
$this
->controller->
page
(
$ids
->
get
(
'page'
)
,
new
Request
(
)
,
$this
->
createMock
(
SalesChannelContext::
class
)
)
;