1--TEST--
2Test normal operation of password_get_info()
3--FILE--
4<?php
5//-=-=-=-
6// Test Bcrypt
7var_dump(password_get_info('$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y'));
8// Test Bcrypt Cost
9var_dump(password_get_info('$2y$11$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y'));
10// Test Bcrypt Invalid Length
11var_dump(password_get_info('$2y$11$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100'));
12// Test Non-Bcrypt
13var_dump(password_get_info('$1$rasmusle$rISCgZzpwk3UhDidwXvin0'));
14
15echo "OK!";
16?>
17--EXPECT--
18array(3) {
19  ["algo"]=>
20  string(2) "2y"
21  ["algoName"]=>
22  string(6) "bcrypt"
23  ["options"]=>
24  array(1) {
25    ["cost"]=>
26    int(10)
27  }
28}
29array(3) {
30  ["algo"]=>
31  string(2) "2y"
32  ["algoName"]=>
33  string(6) "bcrypt"
34  ["options"]=>
35  array(1) {
36    ["cost"]=>
37    int(11)
38  }
39}
40array(3) {
41  ["algo"]=>
42  NULL
43  ["algoName"]=>
44  string(7) "unknown"
45  ["options"]=>
46  array(0) {
47  }
48}
49array(3) {
50  ["algo"]=>
51  NULL
52  ["algoName"]=>
53  string(7) "unknown"
54  ["options"]=>
55  array(0) {
56  }
57}
58OK!
59