fix(auth): update refresh token behavior to be reusable within TTL and add tests for token functionality
This commit is contained in:
@@ -32,7 +32,9 @@ abstract class ApiTestCase extends WebTestCase
|
||||
*/
|
||||
protected function createUser(array $roles = ['ROLE_USER'], ?string $mobile = null): User
|
||||
{
|
||||
$mobile ??= '0912' . str_pad((string) random_int(0, 9_999_999), 7, '0', STR_PAD_LEFT);
|
||||
// 9 random digits after 09 (full ^09\d{9}$ space) — db_test is never reset,
|
||||
// so a narrower space eventually collides on the unique mobile.
|
||||
$mobile ??= '09' . str_pad((string) random_int(0, 999_999_999), 9, '0', STR_PAD_LEFT);
|
||||
$user = new User($mobile);
|
||||
$user->setRoles($roles);
|
||||
$user->setStatus(1);
|
||||
|
||||
Reference in New Issue
Block a user