1--TEST--
2mysqli_send_query()
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifemb.inc');
7require_once('skipifconnectfailure.inc');
8if (!function_exists('mysqli_send_query')) {
9	die("skip mysqli_send_query() not available");
10}
11require_once('connect.inc');
12if (!$TEST_EXPERIMENTAL)
13	die("skip - experimental (= unsupported) feature");
14?>
15--FILE--
16<?php
17	/* NOTE: tests is a stub, but function is deprecated, as long as it does not crash when invoking it... */
18	require_once("connect.inc");
19
20	$tmp    = NULL;
21	$link   = NULL;
22
23	if (NULL !== ($tmp = @mysqli_send_query()))
24		printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
25
26	if (NULL !== ($tmp = @mysqli_send_query($link)))
27		printf("[002] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
28
29	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
30		printf("[003] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
31			$host, $user, $db, $port, $socket);
32	}
33
34	$query = array();
35	if (NULL !== ($tmp = @mysqli_send_query($link, $query)))
36		printf("[004] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
37
38	if (!is_int($tmp = mysqli_send_query($link, 'SELECT 1')))
39		printf("[005] Expecting integer/any value, got %s/%s\n", gettype($tmp), $tmp);
40
41	mysqli_close($link);
42
43	if (NULL !== ($tmp = mysqli_send_query($link, 'SELECT 1')))
44		printf("[006] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
45
46	print "done!";
47?>
48--EXPECTF--
49Warning: mysqli_send_query(): Couldn't fetch mysqli in %s on line %d
50done!