Skip to content

Commit 6cd06d3

Browse files
committed
Fix skip messages
1 parent a5c2940 commit 6cd06d3

File tree

5 files changed

+104
-104
lines changed

5 files changed

+104
-104
lines changed
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
--TEST--
2-
Test normal operation of password_get_info() with Argon2
3-
--SKIPIF--
4-
<?php
5-
if (!defined('PASSWORD_ARGON2I')) die('Skipped: password_get_info not built with Argon2');
6-
?>
7-
--FILE--
8-
<?php
9-
10-
var_dump(password_get_info('$argon2i$v=19$m=65536,t=3,p=1$SWhIcG5MT21Pc01PbWdVZw$WagZELICsz7jlqOR2YzoEVTWb2oOX1tYdnhZYXxptbU'));
11-
echo "OK!";
12-
?>
13-
--EXPECT--
14-
array(3) {
15-
["algo"]=>
16-
int(2)
17-
["algoName"]=>
18-
string(7) "argon2i"
19-
["options"]=>
20-
array(3) {
21-
["memory_cost"]=>
22-
int(65536)
23-
["time_cost"]=>
24-
int(3)
25-
["threads"]=>
26-
int(1)
27-
}
28-
}
1+
--TEST--
2+
Test normal operation of password_get_info() with Argon2
3+
--SKIPIF--
4+
<?php
5+
if (!defined('PASSWORD_ARGON2I')) die('skip password_get_info not built with Argon2');
6+
?>
7+
--FILE--
8+
<?php
9+
10+
var_dump(password_get_info('$argon2i$v=19$m=65536,t=3,p=1$SWhIcG5MT21Pc01PbWdVZw$WagZELICsz7jlqOR2YzoEVTWb2oOX1tYdnhZYXxptbU'));
11+
echo "OK!";
12+
?>
13+
--EXPECT--
14+
array(3) {
15+
["algo"]=>
16+
int(2)
17+
["algoName"]=>
18+
string(7) "argon2i"
19+
["options"]=>
20+
array(3) {
21+
["memory_cost"]=>
22+
int(65536)
23+
["time_cost"]=>
24+
int(3)
25+
["threads"]=>
26+
int(1)
27+
}
28+
}
2929
OK!
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
--TEST--
2-
Test normal operation of password_hash() with argon2
3-
--SKIPIF--
4-
<?php
5-
if (!defined('PASSWORD_ARGON2I')) die('Skipped: password_hash not built with Argon2');
6-
--FILE--
7-
<?php
8-
9-
$password = "the password for testing 12345!";
10-
11-
$hash = password_hash($password, PASSWORD_ARGON2I);
12-
var_dump(password_verify($password, $hash));
13-
14-
echo "OK!";
15-
?>
16-
--EXPECT--
17-
bool(true)
1+
--TEST--
2+
Test normal operation of password_hash() with argon2
3+
--SKIPIF--
4+
<?php
5+
if (!defined('PASSWORD_ARGON2I')) die('skip password_hash not built with Argon2');
6+
--FILE--
7+
<?php
8+
9+
$password = "the password for testing 12345!";
10+
11+
$hash = password_hash($password, PASSWORD_ARGON2I);
12+
var_dump(password_verify($password, $hash));
13+
14+
echo "OK!";
15+
?>
16+
--EXPECT--
17+
bool(true)
1818
OK!
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
--TEST--
2-
Test error operation of password_hash() with argon2
3-
--SKIPIF--
4-
<?php
5-
if (!defined('PASSWORD_ARGON2I')) die('Skipped: password_hash not built with Argon2');
6-
?>
7-
--FILE--
8-
<?php
9-
var_dump(password_hash('test', PASSWORD_ARGON2I, ['memory_cost' => 0]));
10-
var_dump(password_hash('test', PASSWORD_ARGON2I, ['time_cost' => 0]));
11-
var_dump(password_hash('test', PASSWORD_ARGON2I, ['threads' => 0]));
12-
?>
13-
--EXPECTF--
14-
Warning: password_hash(): Memory cost is outside of allowed memory range in %s on line %d
15-
NULL
16-
17-
Warning: password_hash(): Time cost is outside of allowed time range in %s on line %d
18-
NULL
19-
20-
Warning: password_hash(): Invalid number of threads in %s on line %d
1+
--TEST--
2+
Test error operation of password_hash() with argon2
3+
--SKIPIF--
4+
<?php
5+
if (!defined('PASSWORD_ARGON2I')) die('skip password_hash not built with Argon2');
6+
?>
7+
--FILE--
8+
<?php
9+
var_dump(password_hash('test', PASSWORD_ARGON2I, ['memory_cost' => 0]));
10+
var_dump(password_hash('test', PASSWORD_ARGON2I, ['time_cost' => 0]));
11+
var_dump(password_hash('test', PASSWORD_ARGON2I, ['threads' => 0]));
12+
?>
13+
--EXPECTF--
14+
Warning: password_hash(): Memory cost is outside of allowed memory range in %s on line %d
15+
NULL
16+
17+
Warning: password_hash(): Time cost is outside of allowed time range in %s on line %d
18+
NULL
19+
20+
Warning: password_hash(): Invalid number of threads in %s on line %d
2121
NULL
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
--TEST--
2-
Test normal operation of password_needs_rehash() with argon2
3-
--SKIPIF--
4-
<?php
5-
if (!defined('PASSWORD_ARGON2I')) die('Skipped: password_needs_rehash not built with Argon2');
6-
?>
7-
--FILE--
8-
<?php
9-
10-
$hash = '$argon2i$v=19$m=65536,t=3,p=1$YkprUktYN0lHQTd2bWRFeA$79aA+6IvgclpDAJVoezProlqzIPy7do/P0sBDXS9Nn0';
11-
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I));
12-
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['memory_cost' => 1<<17]));
13-
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['time_cost' => 2]));
14-
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['threads' => 2]));
15-
echo "OK!";
16-
?>
17-
--EXPECT--
18-
bool(false)
19-
bool(true)
20-
bool(true)
21-
bool(true)
22-
OK!
1+
--TEST--
2+
Test normal operation of password_needs_rehash() with argon2
3+
--SKIPIF--
4+
<?php
5+
if (!defined('PASSWORD_ARGON2I')) die('skip password_needs_rehash not built with Argon2');
6+
?>
7+
--FILE--
8+
<?php
9+
10+
$hash = '$argon2i$v=19$m=65536,t=3,p=1$YkprUktYN0lHQTd2bWRFeA$79aA+6IvgclpDAJVoezProlqzIPy7do/P0sBDXS9Nn0';
11+
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I));
12+
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['memory_cost' => 1<<17]));
13+
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['time_cost' => 2]));
14+
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['threads' => 2]));
15+
echo "OK!";
16+
?>
17+
--EXPECT--
18+
bool(false)
19+
bool(true)
20+
bool(true)
21+
bool(true)
22+
OK!
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
--TEST--
2-
Test normal operation of password_verify() with argon2
3-
--SKIPIF--
4-
<?php
5-
if (!defined('PASSWORD_ARGON2I')) die('Skipped: password_verify not built with Argon2');
6-
?>
7-
--FILE--
8-
<?php
9-
10-
var_dump(password_verify('test', '$argon2i$v=19$m=65536,t=3,p=1$OEVjWWs2Z3YvWlNZQ0ZmNw$JKin7ahjmh8JYvMyFcXri0Ss/Uvd3uYpD7MG6C/5Cy0'));
11-
12-
var_dump(password_verify('argon2', '$argon2i$v=19$m=65536,t=3,p=1$OEVjWWs2Z3YvWlNZQ0ZmNw$JKin7ahjmh8JYvMyFcXri0Ss/Uvd3uYpD7MG6C/5Cy0'));
13-
echo "OK!";
14-
?>
15-
--EXPECT--
16-
bool(true)
17-
bool(false)
1+
--TEST--
2+
Test normal operation of password_verify() with argon2
3+
--SKIPIF--
4+
<?php
5+
if (!defined('PASSWORD_ARGON2I')) die('skip password_verify not built with Argon2');
6+
?>
7+
--FILE--
8+
<?php
9+
10+
var_dump(password_verify('test', '$argon2i$v=19$m=65536,t=3,p=1$OEVjWWs2Z3YvWlNZQ0ZmNw$JKin7ahjmh8JYvMyFcXri0Ss/Uvd3uYpD7MG6C/5Cy0'));
11+
12+
var_dump(password_verify('argon2', '$argon2i$v=19$m=65536,t=3,p=1$OEVjWWs2Z3YvWlNZQ0ZmNw$JKin7ahjmh8JYvMyFcXri0Ss/Uvd3uYpD7MG6C/5Cy0'));
13+
echo "OK!";
14+
?>
15+
--EXPECT--
16+
bool(true)
17+
bool(false)
1818
OK!

0 commit comments

Comments
 (0)