'eventName' => 'order',
'appVersion' => '0.0.1',
'url' => 'https://test.com',
'serializedWebhookMessage' =>
serialize($webhookEventMessage),
]], Context::
createDefaultContext());
$this->
appendNewResponse(new Response(200
));
($this->webhookEventMessageHandler
)($webhookEventMessage);
$timestamp =
time();
$request =
$this->
getLastRequest();
static::
assertInstanceOf(RequestInterface::
class,
$request);
$payload =
$request->
getBody()->
getContents();
$body =
json_decode($payload, true, 512, \JSON_THROW_ON_ERROR
);
static::
assertEquals('POST',
$request->
getMethod());
static::
assertEquals($body['body'
], 'payload'
);
static::
assertGreaterThanOrEqual($body['timestamp'
],
$timestamp);
static::
assertTrue($request->
hasHeader('sw-version'
));
static::
assertEquals($request->
getHeaderLine('sw-version'
), '6.4'
);
static::
assertEquals($request->
getHeaderLine(AuthMiddleware::SHOPWARE_USER_LANGUAGE
), 'en-GB'
);
static::
assertEquals($request->
getHeaderLine(AuthMiddleware::SHOPWARE_CONTEXT_LANGUAGE
), Defaults::LANGUAGE_SYSTEM
);