use IntegrationTestBehaviour;
public function testUrlContainsAllNecessaryElements(): void
{ $shopUrl = 'test.shop.com';
$secret = 's3cr3t';
$appEndpoint = 'https://test.com/install';
$shopId = Random::
getAlphanumericString(12
);
$handshake =
new PrivateHandshake($shopUrl,
$secret,
$appEndpoint, '',
$shopId, Kernel::SHOPWARE_FALLBACK_VERSION
);
$request =
$handshake->
assembleRequest();
static::
assertStringStartsWith($appEndpoint,
(string) $request->
getUri());
$queryParams =
[];
parse_str($request->
getUri()->
getQuery(),
$queryParams);
static::
assertArrayHasKey('shop-url',
$queryParams);
static::
assertEquals(urlencode($shopUrl),
$queryParams['shop-url'
]);
static::
assertArrayHasKey('shop-id',
$queryParams);
static::
assertEquals($shopId,
$queryParams['shop-id'
]);