Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
AppScriptProductPriceCalculator example
$products
=
[
new
SalesChannelProductEntity
(
)
,
new
SalesChannelProductEntity
(
)
,
]
;
$executor
=
$this
->
createMock
(
ScriptExecutor::
class
)
;
$executor
->
expects
(
static
::
once
(
)
)
->
method
(
'execute'
)
;
$decorated
=
$this
->
createMock
(
ProductPriceCalculator::
class
)
;
$decorated
->
expects
(
static
::
once
(
)
)
->
method
(
'calculate'
)
->
with
(
$products
)
;
$calculator
=
new
AppScriptProductPriceCalculator
(
$decorated
,
$executor
,
$this
->
createMock
(
ScriptPriceStubs::
class
)
)
;
$calculator
->
calculate
(
$products
,
$this
->
createMock
(
SalesChannelContext::
class
)
)
;
}
}