'CONTENT_TYPE' => 'application/json'
],
json_encode([...
$this->
getRegistrationData(), ...
['requestedGroupId' =>
$this->ids->
get('group'
)]], \JSON_THROW_ON_ERROR
) );
$response =
json_decode((string) $this->browser->
getResponse()->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
static::
assertSame('customer',
$response['apiAlias'
]);
/** @var CustomerEntity $customer */
$customer =
$this->customerRepository->
search(new Criteria([$response['id'
]]), Context::
createDefaultContext())->
first();
static::
assertSame($this->ids->
get('group'
),
$customer->
getRequestedGroupId());
} public function testContextChangedBetweenRegistration(): void
{ $context =
$this->
getContainer()->
get(SalesChannelContextFactory::
class) ->
create('test',
$this->
getSalesChannelApiSalesChannelId());
$bag =
new RequestDataBag($this->
getRegistrationData());
$this->
getContainer()->
get(RegisterRoute::
class)->
register($bag,
$context);
static::
assertNotSame('test',
$context->
getToken());
}