Beispiel #1
0
 protected function setUp()
 {
     $tm = new TOTPTimeManager();
     $this->stamp = $tm->getCurrentStamp();
     $this->validator = new TOTPValidator(35, 5);
     $this->key = TOTPKeyGenerator::generate();
 }
Beispiel #2
0
 public function testKeyGeneration()
 {
     for ($i = 0; $i < 15; ++$i) {
         $length = rand(8, 100);
         $key = TOTPKeyGenerator::generate($length);
         $this->assertRegExp(sprintf('#[%s]{%d}#', $this->characters, $length), $key);
     }
 }