Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getBrowserWithLoggedInCustomer example
$request
=
$this
->
createRequest
(
)
;
$request
->
getSession
(
)
->
set
(
AffiliateTrackingListener::AFFILIATE_CODE_KEY, self::TEST_AFFILIATE_CODE
)
;
$order
=
$this
->
performOrder
(
'', false,
$request
)
;
static
::
assertSame
(
self::TEST_AFFILIATE_CODE,
$order
->
getAffiliateCode
(
)
)
;
static
::
assertNull
(
$order
->
getCampaignCode
(
)
)
;
}
public
function
testOrderWithEmptyCartDoesNotResultIn400StatusCode
(
)
: void
{
$browser
=
$this
->
getBrowserWithLoggedInCustomer
(
)
;
$browser
->
request
(
'POST',
$_SERVER
[
'APP_URL'
]
. '/checkout/order',
[
'tos' => 'on',
]
)
;
$response
=
$browser
->
getResponse
(
)
;
static
::
assertLessThan
(
400,
$response
->
getStatusCode
(
)
,
(string)
$response
->
getContent
(
)
)
;
}