Skip to content

Commit 14f78c1

Browse files
committed
Create test case for the deprecation messages
1 parent 66a1e6f commit 14f78c1

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

ext/mysqli/mysqli_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ PHP_FUNCTION(mysqli_get_client_info)
13291329
}
13301330

13311331
if (ZEND_NUM_ARGS()) {
1332-
php_error_docref(NULL, E_WARNING, "This function doesn't require any arguments");
1332+
php_error_docref(NULL, E_DEPRECATED, "passing connection object as an argument is deprecated");
13331333
}
13341334
}
13351335

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
Deprecated messages for mysqli::get_client_info() method
3+
--SKIPIF--
4+
<?php
5+
require_once 'skipif.inc';
6+
require_once 'skipifconnectfailure.inc';
7+
?>
8+
--FILE--
9+
<?php
10+
require 'connect.inc';
11+
12+
if (!$mysqli = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
13+
printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
14+
$host, $user, $db, $port, $socket);
15+
exit(1);
16+
}
17+
18+
printf("client_info = '%s'\n", $mysqli->get_client_info());
19+
20+
printf("client_info = '%s'\n", mysqli_get_client_info($mysqli));
21+
22+
print "done!";
23+
?>
24+
--EXPECTF--
25+
26+
Deprecated: Method mysqli::get_client_info() is deprecated in %s
27+
client_info = '%s'
28+
29+
Deprecated: mysqli_get_client_info(): passing connection object as an argument is deprecated in %s
30+
client_info = '%s'
31+
done!

0 commit comments

Comments
 (0)