This commit is contained in:
@ -18,7 +18,7 @@ final class SecurityPathsTest extends QdbTestCase
|
||||
'INSERT INTO session (token, userID, role, entityID, createdAt, expiresAt, temp)
|
||||
VALUES (:t, :uid, :role, :eid, :ca, :ea, 0)'
|
||||
)->execute([
|
||||
':t' => $token,
|
||||
':t' => token_storage_key($token),
|
||||
':uid' => $f->adminUserId,
|
||||
':role' => 'admin',
|
||||
':eid' => 'ent',
|
||||
|
||||
@ -20,6 +20,11 @@ final class TokenTest extends QdbTestCase
|
||||
$rec = token_get_record($token);
|
||||
$this->assertNotNull($rec);
|
||||
$this->assertSame('admin', $rec['role']);
|
||||
[$pdo, $tmpDb, $lockFp] = qdb_open(false);
|
||||
$stored = $pdo->query('SELECT token FROM session LIMIT 1')->fetchColumn();
|
||||
qdb_discard($tmpDb, $lockFp);
|
||||
$this->assertSame(token_storage_key($token), $stored);
|
||||
$this->assertNotSame($token, $stored);
|
||||
|
||||
token_revoke($token);
|
||||
$this->assertNull(token_get_record($token));
|
||||
|
||||
Reference in New Issue
Block a user