Skip to content

Commit 6534d1f

Browse files
committed
Add sensitive_parameter.phpt to PDO
This tests that sensitive parameters work correctly for methods, instead of just global functions.
1 parent 6960dd1 commit 6534d1f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Test that sensitive parameters are marked sensitive.
3+
--EXTENSIONS--
4+
pdo
5+
--FILE--
6+
<?php
7+
try {
8+
new PDO('dsn', 'username', 'password');
9+
} catch (\Throwable $e) {
10+
echo $e, PHP_EOL;
11+
}
12+
?>
13+
--EXPECTF--
14+
PDOException: PDO::__construct(): Argument #1 ($dsn) must be a valid data source name in %s:%d
15+
Stack trace:
16+
#0 %s(%d): PDO->__construct('dsn', 'username', Object(SensitiveParameterValue))
17+
#1 {main}

0 commit comments

Comments
 (0)