public function testReplaceWithoutExistingContext(): void
{ $token = Random::
getAlphanumericString(32
);
$context =
$this->
createMock(SalesChannelContext::
class);
$salesChannel =
(new SalesChannelEntity())->
assign(['id' => TestDefaults::SALES_CHANNEL
]);
$context->
method('getSalesChannel'
)->
willReturn($salesChannel);
$newToken =
$this->contextPersister->
replace($token,
$context);
static::
assertTrue($this->
contextExists($newToken));
static::
assertFalse($this->
contextExists($token));
} public function testSaveReplaceWithExistingContext(): void
{ $token = Random::
getAlphanumericString(32
);
$this->connection->
insert('sales_channel_api_context',
[ 'token' =>
$token,
'payload' =>
json_encode([ 'first' => 'test',