Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
SortedShippingMethodRoute example
$this
->response =
new
ShippingMethodRouteResponse
(
new
EntitySearchResult
(
'entity',
1,
new
ShippingMethodCollection
(
[
$shippingMethod
]
)
,
null,
new
Criteria
(
)
,
Context::
createDefaultContext
(
)
)
)
;
$this
->sortedRoute =
new
SortedShippingMethodRoute
(
$this
->decorated,
$this
->executor
)
;
}
public
function
testTriggersScriptHookExecution
(
)
: void
{
$this
->decorated
->
expects
(
static
::
once
(
)
)
->
method
(
'load'
)
->
willReturn
(
$this
->response
)
;
$this
->executor->
method
(
'execute'
)
->
with
(
static
::
callback
(
fn
(
ShippingMethodRouteHook
$hook
)
=>
$hook
->
getCollection
(
)
===
$this
->response->
getShippingMethods
(
)
&&
$hook
->
getSalesChannelContext
(
)
===
$this
->context