xref: /php-src/ext/pgsql/tests/changepassword.phpt (revision 5853cdb7)
1--TEST--
2Changing user password with pg_change_password
3--EXTENSIONS--
4pgsql
5--SKIPIF--
6<?php include("inc/skipif.inc"); ?>
7--FILE--
8<?php
9include('inc/config.inc');
10
11$conn = pg_connect($conn_str);
12
13try {
14	pg_change_password($conn, "", "pass");
15} catch (\ValueError $e) {
16	echo $e->getMessage() . PHP_EOL;
17}
18try {
19	pg_change_password($conn, "user", "");
20} catch (\ValueError $e) {
21	echo $e->getMessage() . PHP_EOL;
22}
23
24var_dump(pg_change_password($conn, "inexistent_user", "postitpwd"));
25?>
26--EXPECT--
27pg_change_password(): Argument #2 ($user) must not be empty
28pg_change_password(): Argument #3 ($password) must not be empty
29bool(false)
30