[prev in list] [next in list] [prev in thread] [next in thread]
List: pecl-cvs
Subject: [PECL-CVS] [pecl-database-mysql_xdevapi] release/8.0.30: tests: Using the global user account for au
From: Rafal Somla <noreply () php ! net>
Date: 2022-07-26 10:54:18
Message-ID: 6odS7TgeaqGRdiL5q19vGDgJbAIvHVEXNXBP7ggnE () main ! php ! net
[Download RAW message or body]
Author: Rafal Somla (rsomla1)
Pusher: hramilison
Date: 2022-06-28T15:34:56+02:00
Commit: https://github.com/php/pecl-database-mysql_xdevapi/commit/48feb5a723be7233c20cf7dc369312702c05d5b4
Raw diff: https://github.com/php/pecl-database-mysql_xdevapi/commit/48feb5a723be7233c20cf7dc369312702c05d5b4.diff
tests: Using the global user account for auth/timeout tests
Changed paths:
M tests/auth/timeout/incorrect_timeout.phpt
M tests/auth/timeout/successful_no_timeout.phpt
M tests/auth/timeout/timeout_utils.inc
Diff:
diff --git a/tests/auth/timeout/incorrect_timeout.phpt \
b/tests/auth/timeout/incorrect_timeout.phpt index b5544864..516d34c8 100644
--- a/tests/auth/timeout/incorrect_timeout.phpt
+++ b/tests/auth/timeout/incorrect_timeout.phpt
@@ -32,85 +32,85 @@ print "done!\n";
clean_test_db();
?>
--EXPECTF--
-mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout=-5
+mysqlx://%s:%S@127.0.0.1/?connect-timeout=-5
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1:81/?connect-timeout=-10
+mysqlx://%s:%S@127.0.0.1:81/?connect-timeout=-10
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1:80/?connect-timeout=this_is_incorrect_timeout
+mysqlx://%s:%S@127.0.0.1:80/?connect-timeout=this_is_incorrect_timeout
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is 'this_is_incorrect_timeout'.
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1:82/?connect-timeout=invalid-time-out
+mysqlx://%s:%S@127.0.0.1:82/?connect-timeout=invalid-time-out
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is 'invalid-time-out'.
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout=-1.1
+mysqlx://%s:%S@127.0.0.1/?connect-timeout=-1.1
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1:83/?connect-timeout=-10.101
+mysqlx://%s:%S@127.0.0.1:83/?connect-timeout=-10.101
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout= ,
+mysqlx://%s:%S@127.0.0.1/?connect-timeout= ,
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is ','.
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout=++--
+mysqlx://%s:%S@127.0.0.1/?connect-timeout=++--
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is '++--'.
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout=
+mysqlx://%s:%S@127.0.0.1/?connect-timeout=
[10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty.
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout=-5
+mysqlx://%s:%S@198.51.100.255/?connect-timeout=-5
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255:81/?connect-timeout=-10
+mysqlx://%s:%S@198.51.100.255:81/?connect-timeout=-10
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255:80/?connect-timeout=this_is_incorrect_timeout
+mysqlx://%s:%S@198.51.100.255:80/?connect-timeout=this_is_incorrect_timeout
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is 'this_is_incorrect_timeout'.
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255:82/?connect-timeout=invalid-time-out
+mysqlx://%s:%S@198.51.100.255:82/?connect-timeout=invalid-time-out
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is 'invalid-time-out'.
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout=-1.1
+mysqlx://%s:%S@198.51.100.255/?connect-timeout=-1.1
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255:83/?connect-timeout=-10.101
+mysqlx://%s:%S@198.51.100.255:83/?connect-timeout=-10.101
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout= ,
+mysqlx://%s:%S@198.51.100.255/?connect-timeout= ,
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is ','.
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout=++--
+mysqlx://%s:%S@198.51.100.255/?connect-timeout=++--
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is '++--'.
----------------------
-mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout=
+mysqlx://%s:%S@198.51.100.255/?connect-timeout=
[10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty.
----------------------
-mysqlx://testuser:testpasswd@localhost/?connect-timeout=-5
+mysqlx://%s:%S@localhost/?connect-timeout=-5
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@localhost:81/?connect-timeout=-10
+mysqlx://%s:%S@localhost:81/?connect-timeout=-10
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@localhost:80/?connect-timeout=this_is_incorrect_timeout
+mysqlx://%s:%S@localhost:80/?connect-timeout=this_is_incorrect_timeout
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is 'this_is_incorrect_timeout'.
----------------------
-mysqlx://testuser:testpasswd@localhost:82/?connect-timeout=invalid-time-out
+mysqlx://%s:%S@localhost:82/?connect-timeout=invalid-time-out
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is 'invalid-time-out'.
----------------------
-mysqlx://testuser:testpasswd@localhost/?connect-timeout=-1.1
+mysqlx://%s:%S@localhost/?connect-timeout=-1.1
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@localhost:83/?connect-timeout=-10.101
+mysqlx://%s:%S@localhost:83/?connect-timeout=-10.101
[10050][HY000] TypeError: The connection timeout value must be a positive integer \
(including 0).
----------------------
-mysqlx://testuser:testpasswd@localhost/?connect-timeout= ,
+mysqlx://%s:%S@localhost/?connect-timeout= ,
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is ','.
----------------------
-mysqlx://testuser:testpasswd@localhost/?connect-timeout=++--
+mysqlx://%s:%S@localhost/?connect-timeout=++--
[10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, \
but it is '++--'.
----------------------
-mysqlx://testuser:testpasswd@localhost/?connect-timeout=
+mysqlx://%s:%S@localhost/?connect-timeout=
[10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty.
----------------------
done!%A
diff --git a/tests/auth/timeout/successful_no_timeout.phpt \
b/tests/auth/timeout/successful_no_timeout.phpt index 2ad54587..75d48a34 100644
--- a/tests/auth/timeout/successful_no_timeout.phpt
+++ b/tests/auth/timeout/successful_no_timeout.phpt
@@ -25,16 +25,16 @@ print "done!\n";
clean_test_db();
?>
--EXPECTF--
-mysqlx://testuser:testpasswd@127.0.0.1:%d/?connect-timeout=4
+mysqlx://%s:%S@127.0.0.1:%d/?connect-timeout=4
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1:%d
+mysqlx://%s:%S@127.0.0.1:%d
----------------------
-mysqlx://testuser:testpasswd@127.0.0.1:%d/?connect-timeout=0
+mysqlx://%s:%S@127.0.0.1:%d/?connect-timeout=0
----------------------
-mysqlx://testuser:testpasswd@localhost:%d/?connect-timeout=7
+mysqlx://%s:%S@localhost:%d/?connect-timeout=7
----------------------
-mysqlx://testuser:testpasswd@localhost:%d
+mysqlx://%s:%S@localhost:%d
----------------------
-mysqlx://testuser:testpasswd@localhost:%d/?connect-timeout=0
+mysqlx://%s:%S@localhost:%d/?connect-timeout=0
----------------------
done!%A
diff --git a/tests/auth/timeout/timeout_utils.inc \
b/tests/auth/timeout/timeout_utils.inc index 3aa3caf2..90a32c17 100644
--- a/tests/auth/timeout/timeout_utils.inc
+++ b/tests/auth/timeout/timeout_utils.inc
@@ -3,8 +3,6 @@
require_once(__DIR__."/../auth_utils.inc");
const Default_connection_time_out = 10;
-const Timeout_test_user = "testuser";
-
const Envar_non_routable_host = "MYSQLX_TEST_NON_ROUTABLE_HOST";
const Envar_non_routable_host_port = "MYSQLX_TEST_NON_ROUTABLE_HOST_PORT";
@@ -43,7 +41,8 @@ $Non_routable_ports = [
function prepare_uri_with_timeout($host, $port, $timeout) {
global $scheme;
global $passwd;
- $uri = $scheme . '://' . Timeout_test_user . ':' . $passwd . '@' . $host;
+ global $user;
+ $uri = $scheme . '://' . $user . ':' . $passwd . '@' . $host;
if ($port !== null) $uri .= ':' . $port;
if ($timeout !== null) $uri .= '/?connect-timeout=' . $timeout;
return $uri;
--
PECL CVS Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic