diff options
Diffstat (limited to 'ext/mysqli/tests')
| -rw-r--r-- | ext/mysqli/tests/bug34810.phpt | 5 | ||||
| -rw-r--r-- | ext/mysqli/tests/bug62885.phpt | 4 | ||||
| -rw-r--r-- | ext/mysqli/tests/bug75434.phpt | 1 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt | 3 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_constants.phpt | 1 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_fetch_all.phpt | 2 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_fetch_all_oo.phpt | 3 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_fetch_field.phpt | 8 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_fetch_field_oo.phpt | 6 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_fetch_fields.phpt | 9 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_kill.phpt | 3 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_result_references.phpt | 6 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt | 28 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_stmt_attr_set.phpt | 6 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt | 12 |
15 files changed, 40 insertions, 57 deletions
diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt index 9157a13b9a..e1568d3038 100644 --- a/ext/mysqli/tests/bug34810.phpt +++ b/ext/mysqli/tests/bug34810.phpt @@ -12,13 +12,14 @@ class DbConnection { public function connect() { require_once("connect.inc"); - $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); + /* Pass false as $connect_flags cannot be accessed via globals. */ + $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket, false); var_dump($link); $link = mysqli_init(); var_dump($link); - $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket); + $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket, false); $mysql->query("DROP TABLE IF EXISTS test_warnings"); $mysql->query("CREATE TABLE test_warnings (a int not null)"); $mysql->query("SET sql_mode=''"); diff --git a/ext/mysqli/tests/bug62885.phpt b/ext/mysqli/tests/bug62885.phpt index 4d02475570..c0815c7f04 100644 --- a/ext/mysqli/tests/bug62885.phpt +++ b/ext/mysqli/tests/bug62885.phpt @@ -12,11 +12,11 @@ if (!$IS_MYSQLND) { <?php error_reporting(E_ALL); $tablica = array(); -$test1 = mysqli_poll($test2, $test3, $tablica, null); +$test1 = mysqli_poll($test2, $test3, $tablica, 0); $test2 = array(); $test2 = array(); -$test1 = mysqli_poll($test2, $test3, $tablica, null); +$test1 = mysqli_poll($test2, $test3, $tablica, 0); echo "okey"; ?> --EXPECTF-- diff --git a/ext/mysqli/tests/bug75434.phpt b/ext/mysqli/tests/bug75434.phpt index 1bc325e29f..3e295d83bf 100644 --- a/ext/mysqli/tests/bug75434.phpt +++ b/ext/mysqli/tests/bug75434.phpt @@ -3,7 +3,6 @@ Bug #75434 Wrong reflection for mysqli_fetch_all function --SKIPIF-- <?php require_once('skipif.inc'); -if (!stristr(mysqli_get_client_info(), 'mysqlnd')) die("skip: only available in mysqlnd"); ?> --FILE-- <?php diff --git a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt index 629697a50c..4837a5f695 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt @@ -27,6 +27,7 @@ require_once('skipifconnectfailure.inc'); '__construct' => true, 'close' => true, 'data_seek' => true, + 'fetch_all' => true, 'fetch_array' => true, 'fetch_assoc' => true, 'fetch_field' => true, @@ -39,8 +40,6 @@ require_once('skipifconnectfailure.inc'); 'free_result' => true, 'getIterator' => true, ); - if ($IS_MYSQLND) - $expected_methods['fetch_all'] = true; foreach ($methods as $k => $method) { if (isset($expected_methods[$method])) { diff --git a/ext/mysqli/tests/mysqli_constants.phpt b/ext/mysqli/tests/mysqli_constants.phpt index 22e3cd9d2b..6297d56b34 100644 --- a/ext/mysqli/tests/mysqli_constants.phpt +++ b/ext/mysqli/tests/mysqli_constants.phpt @@ -93,6 +93,7 @@ mysqli.allow_local_infile=1 "MYSQLI_REFRESH_HOSTS" => true, "MYSQLI_REFRESH_STATUS" => true, "MYSQLI_REFRESH_THREADS" => true, + "MYSQLI_REFRESH_REPLICA" => true, "MYSQLI_REFRESH_SLAVE" => true, "MYSQLI_REFRESH_MASTER" => true, "MYSQLI_DEBUG_TRACE_ENABLED" => true, diff --git a/ext/mysqli/tests/mysqli_fetch_all.phpt b/ext/mysqli/tests/mysqli_fetch_all.phpt index ae99c2ca87..fac34e3d88 100644 --- a/ext/mysqli/tests/mysqli_fetch_all.phpt +++ b/ext/mysqli/tests/mysqli_fetch_all.phpt @@ -4,8 +4,6 @@ mysqli_fetch_all() <?php require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); -if (!function_exists('mysqli_fetch_all')) - die("skip: function only available with mysqlnd"); ?> --FILE-- <?php diff --git a/ext/mysqli/tests/mysqli_fetch_all_oo.phpt b/ext/mysqli/tests/mysqli_fetch_all_oo.phpt index df522f2eeb..ebdc55443c 100644 --- a/ext/mysqli/tests/mysqli_fetch_all_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_all_oo.phpt @@ -4,9 +4,6 @@ $mysqli->fetch_all() (introduced with mysqlnd) <?php require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); - -if (!function_exists('mysqli_fetch_all')) - die("skip: function only available with mysqlnd"); ?> --FILE-- <?php diff --git a/ext/mysqli/tests/mysqli_fetch_field.phpt b/ext/mysqli/tests/mysqli_fetch_field.phpt index 2018d75755..48d30453a0 100644 --- a/ext/mysqli/tests/mysqli_fetch_field.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field.phpt @@ -35,10 +35,6 @@ require_once('skipifconnectfailure.inc'); printf("[004] Expecting charset %s/%d got %d\n", $charsetInfo->charset, $charsetInfo->number, $tmp->charsetnr); } - if ($tmp->length != $charsetInfo->max_length) { - printf("[005] Expecting length %d got %d\n", - $charsetInfo->max_length, $tmp->max_length); - } if ($tmp->db != $db) { printf("011] Expecting database '%s' got '%s'\n", $db, $tmp->db); @@ -97,7 +93,7 @@ object(stdClass)#%d (13) { ["catalog"]=> string(%d) "%s" ["max_length"]=> - int(1) + int(0) ["length"]=> int(11) ["charsetnr"]=> @@ -159,7 +155,7 @@ object(stdClass)#%d (13) { ["catalog"]=> string(%d) "%s" ["max_length"]=> - int(1) + int(0) ["length"]=> int(11) ["charsetnr"]=> diff --git a/ext/mysqli/tests/mysqli_fetch_field_oo.phpt b/ext/mysqli/tests/mysqli_fetch_field_oo.phpt index d655e05a9c..ed0ce107cf 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_oo.phpt @@ -42,10 +42,6 @@ require_once('skipifconnectfailure.inc'); printf("[005] Expecting charset %s/%d got %d\n", $charsetInfo->charset, $charsetInfo->number, $tmp->charsetnr); } - if ($tmp->length != $charsetInfo->max_length) { - printf("[006] Expecting length %d got %d\n", - $charsetInfo->max_length, $tmp->max_length); - } if ($tmp->db != $db) { printf("[007] Expecting database '%s' got '%s'\n", $db, $tmp->db); @@ -86,7 +82,7 @@ object(stdClass)#%d (13) { ["catalog"]=> string(%d) "%s" ["max_length"]=> - int(1) + int(0) ["length"]=> int(11) ["charsetnr"]=> diff --git a/ext/mysqli/tests/mysqli_fetch_fields.phpt b/ext/mysqli/tests/mysqli_fetch_fields.phpt index 7cfad35f87..ae1d12847a 100644 --- a/ext/mysqli/tests/mysqli_fetch_fields.phpt +++ b/ext/mysqli/tests/mysqli_fetch_fields.phpt @@ -35,11 +35,6 @@ require_once('skipifconnectfailure.inc'); $charsetInfo->charset, $charsetInfo->number, $field->charsetnr); } - if ($field->length != $charsetInfo->max_length) { - printf("[005] Expecting length %d got %d\n", - $charsetInfo->max_length, - $field->max_length); - } break; } } @@ -76,7 +71,7 @@ object(stdClass)#%d (13) { ["catalog"]=> string(%d) "%s" ["max_length"]=> - int(1) + int(0) ["length"]=> int(11) ["charsetnr"]=> @@ -104,7 +99,7 @@ object(stdClass)#%d (13) { ["catalog"]=> string(%d) "%s" ["max_length"]=> - int(1) + int(0) ["length"]=> int(%d) ["charsetnr"]=> diff --git a/ext/mysqli/tests/mysqli_kill.phpt b/ext/mysqli/tests/mysqli_kill.phpt index bec08cc1e1..d2c0fc6df6 100644 --- a/ext/mysqli/tests/mysqli_kill.phpt +++ b/ext/mysqli/tests/mysqli_kill.phpt @@ -11,9 +11,8 @@ require_once('skipifconnectfailure.inc'); require('table.inc'); - // Zend will cast the NULL to 0 try { - mysqli_kill($link, null); + mysqli_kill($link, 0); } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } diff --git a/ext/mysqli/tests/mysqli_result_references.phpt b/ext/mysqli/tests/mysqli_result_references.phpt index 2e97cd45d7..c6b34896d8 100644 --- a/ext/mysqli/tests/mysqli_result_references.phpt +++ b/ext/mysqli/tests/mysqli_result_references.phpt @@ -5,6 +5,8 @@ References to result sets require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); ?> +--INI-- +opcache.enable=0 --FILE-- <?php require_once('connect.inc'); @@ -136,9 +138,9 @@ array(1) refcount(2){ [0]=> array(2) refcount(1){ ["id"]=> - string(1) "1" refcount(%d) + string(1) "1" interned ["label"]=> - string(1) "a" refcount(%d) + string(1) "a" interned } } done! diff --git a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt index 3c44f8a309..bdd37c79f3 100644 --- a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt +++ b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt @@ -59,14 +59,14 @@ array(1) refcount(%d){ ["row_copy"]=> array(2) refcount(1){ ["id"]=> - string(1) "1" refcount(%d) + string(1) "1" interned ["label"]=> - string(1) "a" refcount(%d) + string(1) "a" interned } ["id_ref"]=> - string(1) "1" refcount(%d) + string(1) "1" interned ["id_copy"]=> - string(1) "1" refcount(%d) + string(1) "1" interned } } array(2) refcount(%d){ @@ -77,35 +77,35 @@ array(2) refcount(%d){ ["row_copy"]=> array(2) refcount(%d){ ["id"]=> - string(1) "1" refcount(%d) + string(1) "1" interned ["label"]=> - string(1) "a" refcount(%d) + string(1) "a" interned } ["id_ref"]=> - string(1) "1" refcount(%d) + string(1) "1" interned ["id_copy"]=> - string(1) "1" refcount(%d) + string(1) "1" interned } [1]=> array(5) refcount(%d){ ["row_ref"]=> &array(2) refcount(%d){ ["id"]=> - &string(1) "2" refcount(%d) + &string(1) "2" interned ["label"]=> - string(1) "b" refcount(%d) + string(1) "b" interned } ["row_copy"]=> array(2) refcount(%d){ ["id"]=> - string(1) "2" refcount(%d) + string(1) "2" interned ["label"]=> - string(1) "b" refcount(%d) + string(1) "b" interned } ["id_ref"]=> - &string(1) "2" refcount(%d) + &string(1) "2" interned ["id_copy"]=> - string(1) "2" refcount(%d) + string(1) "2" interned ["id_copy_mod"]=> int(2) } diff --git a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt index 0edbc578e8..634faa01c3 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt @@ -61,7 +61,7 @@ require_once("connect.inc"); $res->close(); $stmt->close(); - // expecting max_length to _be_ set + // MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH is no longer supported, expect no change in behavior. $stmt = mysqli_stmt_init($link); $stmt->prepare("SELECT label FROM test"); var_dump($stmt->attr_set(MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, 1)); @@ -75,8 +75,8 @@ require_once("connect.inc"); $max_lengths = array(); foreach ($fields as $k => $meta) { $max_lengths[$meta->name] = $meta->max_length; - if ($meta->max_length === 0) - printf("[008] max_length should be set (!= 0), got %s for field %s\n", $meta->max_length, $meta->name); + if ($meta->max_length !== 0) + printf("[008] max_length should be not set (= 0), got %s for field %s\n", $meta->max_length, $meta->name); } $res->close(); $stmt->close(); diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt index f2428aeb92..9a0e52d5cb 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt @@ -35,12 +35,12 @@ if (!function_exists('mysqli_stmt_get_result')) printf("[004] It is very unlikely that SHOW ENGINES returns no data, check manually\n"); } else { $found = false; - foreach ($engines as $k => $engine) - foreach ($engine as $k => $v) - if (stristr($v, 'MyISAM')) { - $found = true; - break; - } + foreach ($engines as $engine) { + if (stristr($engine[0], 'MyISAM')) { + $found = true; + break; + } + } if (!$found) printf("[005] It is very unlikely that SHOW ENGINES does not show MyISAM, check manually\n"); } |
