Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
cartJson example
static
::
assertEquals
(
new
Response
(
)
,
$response
)
;
}
public
function
testGetCartJson
(
)
: void
{
$cart
=
new
Cart
(
Uuid::
randomHex
(
)
)
;
$this
->cartLoadRouteMock->
method
(
'load'
)
->
willReturn
(
new
CartResponse
(
$cart
)
)
;
$response
=
$this
->controller->
cartJson
(
new
Request
(
)
,
$this
->
createMock
(
SalesChannelContext::
class
)
)
;
static
::
assertEquals
(
new
CartResponse
(
$cart
)
,
$response
)
;
}
public
function
testConfirmPageNoCustomer
(
)
: void
{
$context
=
$this
->
createMock
(
SalesChannelContext::
class
)
;
$context
->
method
(
'getCustomer'
)
->
willReturn
(
null
)
;
$response
=
$this
->controller->
confirmPage
(
new
Request
(
)
,
$context
)
;