Skip to content

Commit 21522ac

Browse files
authored
Test characters in auth tokens
1 parent 36c2965 commit 21522ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/csrfprotector_test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,12 @@ public function testGenerateAuthToken()
356356

357357
$this->assertFalse($token1 == $token2);
358358
$this->assertEquals(strlen($token1), 20);
359+
$this->assertRegExp('/^[a-z0-9]{20}$/', $token1);
359360

360361
csrfprotector::$config['tokenLength'] = 128;
361362
$token = csrfprotector::generateAuthToken();
362363
$this->assertEquals(strlen($token), 128);
364+
$this->assertRegExp('/^[a-z0-9]{128}$/', $token);
363365
}
364366

365367
/**

0 commit comments

Comments
 (0)