Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
assertRequestIsSigned example
static
::
assertNotNull
(
$setup
)
;
$uriWithoutQuery
=
$registrationRequest
->
getUri
(
)
->
withQuery
(
''
)
;
static
::
assertEquals
(
$setup
->
getRegistrationUrl
(
)
,
(string)
$uriWithoutQuery
)
;
static
::
assertNotEmpty
(
$registrationRequest
->
getHeaderLine
(
'sw-version'
)
)
;
static
::
assertNotEmpty
(
$registrationRequest
->
getHeaderLine
(
AuthMiddleware::SHOPWARE_USER_LANGUAGE
)
)
;
static
::
assertNotEmpty
(
$registrationRequest
->
getHeaderLine
(
AuthMiddleware::SHOPWARE_CONTEXT_LANGUAGE
)
)
;
$secret
=
$setup
->
getSecret
(
)
;
static
::
assertNotNull
(
$secret
)
;
$this
->
assertRequestIsSigned
(
$registrationRequest
,
$secret
)
;
$app
=
$this
->
fetchApp
(
$id
)
;
static
::
assertEquals
(
TestAppServer::APP_SECRET,
$app
->
getAppSecret
(
)
)
;
static
::
assertEquals
(
2,
$this
->
getRequestCount
(
)
)
;
$confirmationReq
=
$this
->
getPastRequest
(
1
)
;
static
::
assertEquals
(
'POST',
$confirmationReq
->
getMethod
(
)
)
;
$postBody
= \
json_decode
(
$confirmationReq
->
getBody
(
)
->
getContents
(
)
, true, 512, \JSON_THROW_ON_ERROR
)
;