$body = '{"method":"hi.nam","params":["1","2","3"]}';
$post =
new RequestSigner();
$signature =
$post->
signPayload($body,
$this->authSecret
);
$responseHeaders =
[ RequestSigner::SHOPWARE_APP_SIGNATURE =>
$signature,
];
$response =
new Response(200,
$responseHeaders,
$body);
static::
assertTrue($post->
isResponseAuthentic($response,
$this->authSecret
));
static::
assertNotEmpty($response->
getBody()->
getContents());
} public function testIsResponseAuthenticRequiredWithoutHeader(): void
{ $response =
new Response(200
);
$post =
new RequestSigner();
static::
assertFalse($post->
isResponseAuthentic($response,
$this->authSecret
));
}