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
);
static::
assertTrue($request->
hasHeader('shopware-shop-signature'
));
static::
assertEquals( hash_hmac('sha256',
$payload, 's3cr3t'
),
$request->
getHeaderLine('shopware-shop-signature'
) );
$webhookEventLog =
$webhookEventLogRepository->
search(new Criteria([$webhookEventId]), Context::
createDefaultContext())->
first();
static::
assertEquals($webhookEventLog->
getDeliveryStatus(), WebhookEventLogDefinition::STATUS_SUCCESS
);
} /**
* If the app gets deleted between the time the message was generated and the message was again handled, the handling should not fail
* this especially affects `app.deleted` events
*/
public function testCanStillSendAfterWebhookIsDeleted(): void
{ $webhookId = Uuid::
randomHex();
$appId = Uuid::
randomHex();