Skip to content

Commit 7da8ebd

Browse files
committed
Add test for display_error_function_args
If this is not enabled by default for tests (like the fatal error backtrace RFC), then at least test for it.
1 parent 7434069 commit 7da8ebd

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
Displaying function arguments in errors
3+
--INI--
4+
display_error_function_args=On
5+
--FILE--
6+
<?php
7+
8+
// A function that sets its own parameters in docref call, to compare
9+
unlink('/');
10+
// Something with sensitive parameters that exists in a minimal build,
11+
// and also doesn't set anything in the docref call
12+
// XXX: May be better to provide a new zend_test func?
13+
password_hash("test", PASSWORD_BCRYPT, array("salt" => "123456789012345678901" . chr(0)));
14+
15+
ini_set("display_error_function_args", "Off");
16+
17+
unlink('/');
18+
password_hash("test", PASSWORD_BCRYPT, array("salt" => "123456789012345678901" . chr(0)));
19+
20+
?>
21+
--EXPECTF--
22+
Warning: unlink('/'): %s in %s on line %d
23+
24+
Warning: password_hash(Object(SensitiveParameterValue), '2y', Array): The "salt" option has been ignored, since providing a custom salt is no longer supported in %s on line %d
25+
26+
Warning: unlink(/): %s in %s on line %d
27+
28+
Warning: password_hash(): The "salt" option has been ignored, since providing a custom salt is no longer supported in %s on line %d

0 commit comments

Comments
 (0)