Skip to content

Commit f4d02a5

Browse files
committed
add tests
1 parent 25018f0 commit f4d02a5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
Changing user password with pg_change_password
3+
--EXTENSIONS--
4+
pgsql
5+
--SKIPIF--
6+
<?php include("inc/skipif.inc"); ?>
7+
--FILE--
8+
<?php
9+
include('inc/config.inc');
10+
11+
$conn = pg_connect($conn_str);
12+
13+
try {
14+
pg_change_password($conn, "", "pass");
15+
} catch (\ValueError $e) {
16+
echo $e->getMessage() . PHP_EOL;
17+
}
18+
try {
19+
pg_change_password($conn, "user", "");
20+
} catch (\ValueError $e) {
21+
echo $e->getMessage() . PHP_EOL;
22+
}
23+
24+
var_dump(pg_change_password($conn, "inexistent_user", "postitpwd"));
25+
?>
26+
--EXPECT--
27+
pg_change_password(): Argument #2 ($user) cannot be empty
28+
pg_change_password(): Argument #3 ($password) cannot be empty
29+
bool(false)

0 commit comments

Comments
 (0)