public function testSignHeaderAddedRequest(): void
{ $body = '{"method":"hi.nam","params":["1","2","3"]}';
$hashExpected =
hash_hmac('sha256',
$body,
$this->authSecret
);
$request =
new Request('POST', 'https://example.local',
[],
$body);
$post =
new RequestSigner();
$request =
$post->
signRequest($request,
$this->authSecret
);
static::
assertTrue($request->
hasHeader(RequestSigner::SHOPWARE_SHOP_SIGNATURE
));
static::
assertEquals($hashExpected,
$request->
getHeader(RequestSigner::SHOPWARE_SHOP_SIGNATURE
)[0
]);
} public function testSignHeaderWithoutAddedMethodGet(): void
{ $request =
new Request('GET', 'https://example.local',
[]);
$post =
new RequestSigner();