-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashTest.php
More file actions
38 lines (35 loc) · 1.02 KB
/
HashTest.php
File metadata and controls
38 lines (35 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php // vim:ts=3:sts=3:sw=3:et:
/**
* Test class for MindFrame2_Hash
*
* PHP Version 5
*
* @category PHP
* @package MindFrame2
* @author Bryan C. Geraghty <bryan@ravensight.org>
* @copyright 2005-2011 Bryan C. Geraghty
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL
* @link https://github.com/archwisp/MindFrame2
*/
/**
* Test class for MindFrame2_Hash
*
* @category PHP
* @package MindFrame2
* @author Bryan C. Geraghty <bryan@ravensight.org>
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL
* @link https://github.com/archwisp/MindFrame2
*/
class MindFrame2_HashTest extends PHPUnit_Framework_TestCase
{
public function testGenerateToken()
{
$token = MindFrame2_Hash::generateToken('FooBar', '123456', 32);
$this->assertEquals('8MT4KAeO5zUaNEXcUjGdwU9c08OGrs+iOR+2T/akesk=', base64_encode($token));
}
public function testGenerateSalt()
{
$token = MindFrame2_Hash::generateSalt(128);
$this->assertEquals(128, strlen($token));
}
}