Example #1
0
 public function testVerifyClientNonce()
 {
     $cache = new MemcachedCache(60);
     $server = new Server(null, $cache);
     $client = new Client();
     $cnonce = $client->createNonce();
     $this->assertEquals(24, strlen($cnonce));
     // Verify that it is a virgin
     $server->verifyClientNonce($cnonce);
     $this->assertTrue(true);
     // Cannot verify a second time.
     try {
         $server->verifyClientNonce($cnonce);
         $this->assertTrue(false);
     } catch (NonceException $e) {
         $this->assertTrue(true);
     }
 }
Example #2
0
 public function testCreateClientNonce()
 {
     $client = new Client();
     $cnonce = $client->createNonce();
     $this->assertEquals(24, strlen($cnonce));
 }