summaryrefslogtreecommitdiffstats
path: root/tests/password_compat.phpt
blob: 3dd6ad246f9a9140879d5a615f735a59c2dd0549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Test crypt compatibility with password_hash
--FILE--
<?php
$secret = 'mysecret';

/* generate with password_hash, check with both */
$h = password_hash($secret, PASSWORD_BCRYPT);
var_dump($h, password_verify($secret, $h), $h===crypt($secret, $h));

/* generate with crypt, check with both */
$h = crypt($secret, crypt_gensalt(XPASS_CRYPT_BLOWFISH));
var_dump($h, password_verify($secret, $h), $h===crypt($secret, $h));
?>
--EXPECTF--
string(60) "$2y$%s$%s"
bool(true)
bool(true)
string(60) "$2y$%s$%s"
bool(true)
bool(true)