$customerId =
$this->
createCustomer();
$token = Random::
getAlphanumericString(32
);
$this->connection->
insert('sales_channel_api_context',
[ 'token' =>
$token,
'payload' =>
json_encode(['foo' => 'bar'
]),
'customer_id' => Uuid::
fromHexToBytes($customerId),
'sales_channel_id' => Uuid::
fromHexToBytes(TestDefaults::SALES_CHANNEL
),
]);
$this->contextPersister->
revokeAllCustomerTokens($customerId);
static::
assertNull($this->connection->
fetchOne('SELECT customer_id FROM sales_channel_api_context'
));
} public static function tokenExpiringDataProvider(): \Generator
{ yield [0, 'P2D', false
];
yield [1, 'P2D', false
];
yield [3, 'P2D', true
];
yield [0, 'P1D', false
];
yield [2, 'P1D', true
];
}