1 <?php
2
3 class PasswordGetInfoTest extends PHPUnit_Framework_TestCase {
4
5 public static function provideInfo() {
6 return array(
7 array('foo', array('algo' => 0, 'algoName' => 'unknown', 'options' => array())),
8 array('$2y$', array('algo' => 0, 'algoName' => 'unknown', 'options' => array())),
9 array('$2y$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', array('algo' => PASSWORD_BCRYPT, 'algoName' => 'bcrypt', 'options' => array('cost' => 7))),
10 array('$2y$10$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', array('algo' => PASSWORD_BCRYPT, 'algoName' => 'bcrypt', 'options' => array('cost' => 10))),
11
12 );
13 }
14
15 public function testFuncExists() {
16 $this->assertTrue(function_exists('password_get_info'));
17 }
18
19 20 21
22 public function testInfo($hash, $info) {
23 $this->assertEquals($info, password_get_info($hash));
24 }
25
26 }