From: Dmitry Stogov Date: Fri, 15 Aug 2014 09:35:52 +0000 (+0400) Subject: Fixed PHP6 unicode related tests X-Git-Tag: PRE_64BIT_BRANCH_MERGE~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f281e0cf5342eceb7c4a17947754e569773730a4;p=php Fixed PHP6 unicode related tests --- diff --git a/ext/mysqli/tests/045.phpt b/ext/mysqli/tests/045.phpt index d11c16636a..b643d159ae 100644 --- a/ext/mysqli/tests/045.phpt +++ b/ext/mysqli/tests/045.phpt @@ -31,7 +31,7 @@ mysqli_stmt_bind_result (SHOW) mysqli_stmt_bind_result($stmt, $c1, $c2); mysqli_stmt_fetch($stmt); mysqli_stmt_close($stmt); - if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && mysqli_get_server_version($link) < 50000) { + if ((version_compare(PHP_VERSION, '6.0', '==') == 1) && mysqli_get_server_version($link) < 50000) { /* variables are binary */ settype($c1, "unicode"); settype($c2, "unicode"); diff --git a/ext/mysqli/tests/065.phpt b/ext/mysqli/tests/065.phpt index 9426644c9d..fbdf6e1277 100644 --- a/ext/mysqli/tests/065.phpt +++ b/ext/mysqli/tests/065.phpt @@ -8,7 +8,7 @@ require_once('skipifconnectfailure.inc'); if (!function_exists('mysqli_set_charset')) { die('skip mysqli_set_charset() not available'); } -if (version_compare(PHP_VERSION, '5.9.9', '>') == 1) { +if (version_compare(PHP_VERSION, '6.0', '==') == 1) { die('skip set character set not functional with PHP 6 (fomerly PHP 6 && unicode.semantics=On)'); } ?> diff --git a/ext/mysqli/tests/bug35517.phpt b/ext/mysqli/tests/bug35517.phpt index 772dc30fa0..d2ef748e45 100644 --- a/ext/mysqli/tests/bug35517.phpt +++ b/ext/mysqli/tests/bug35517.phpt @@ -24,8 +24,7 @@ require_once('skipifconnectfailure.inc'); if (gettype($id) !== 'string') { printf("[002] Expecting string on 32bit got %s/%s\n", gettype($id), var_export($id, true)); } - if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && - (version_compare(PHP_VERSION, '6.9.9', '<=') == 1) && + if ((version_compare(PHP_VERSION, '6.0', '==') == 1) && !is_unicode($id)) { printf("[003] Expecting unicode string\n"); } diff --git a/ext/mysqli/tests/bug37090.phpt b/ext/mysqli/tests/bug37090.phpt index 839081df53..7c5a44851e 100644 --- a/ext/mysqli/tests/bug37090.phpt +++ b/ext/mysqli/tests/bug37090.phpt @@ -7,7 +7,7 @@ require_once('skipifconnectfailure.inc'); if (!function_exists('mysqli_set_charset')) { die('skip mysqli_set_charset() not available'); } -if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) { +if ((version_compare(PHP_VERSION, '6.0', '==') == 1)) { die("skip Functionality not available in unicode mode"); } ?> diff --git a/ext/mysqli/tests/mysqli_change_user_set_names.phpt b/ext/mysqli/tests/mysqli_change_user_set_names.phpt index 3579e31358..913ade275e 100644 --- a/ext/mysqli/tests/mysqli_change_user_set_names.phpt +++ b/ext/mysqli/tests/mysqli_change_user_set_names.phpt @@ -129,7 +129,7 @@ if ($version[0] <= 4 && $version[1] < 1) var_dump($defaults); } - if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) { + if ((version_compare(PHP_VERSION, '6.0', '==') == 1)) { // charsets cannot take any other value but utf8 in unicode mode $defaults['charset_client'] = 'utf8'; $defaults['charset_connection'] = 'utf8'; diff --git a/ext/mysqli/tests/mysqli_character_set.phpt b/ext/mysqli/tests/mysqli_character_set.phpt index 1bfe9cbdaa..7c25473331 100644 --- a/ext/mysqli/tests/mysqli_character_set.phpt +++ b/ext/mysqli/tests/mysqli_character_set.phpt @@ -10,9 +10,6 @@ require_once('skipifemb.inc'); if (!function_exists('mysqli_set_charset')) { die('skip mysqli_set_charset() not available'); } -if (version_compare(PHP_VERSION, '5.9.9', '>') == 1) { - die('skip set character set not functional with PHP 6 (fomerly PHP 6 && unicode.semantics=On)'); -} ?> --FILE-- ') == 1)) { + if (!(version_compare(PHP_VERSION, '6.0', '==') == 1)) { mysqli_query($link, "set names utf8"); } diff --git a/ext/mysqli/tests/mysqli_get_client_stats.phpt b/ext/mysqli/tests/mysqli_get_client_stats.phpt index a22fc58f53..a61165ae15 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats.phpt @@ -119,7 +119,7 @@ mysqlnd.collect_memory_statistics=1 mysqli_get_client_stats_assert_eq('result_set_queries', $new_info, $info, $test_counter); /* we need to skip this test in unicode - we send set names utf8 during mysql_connect */ - if (!(version_compare(PHP_VERSION, '5.9.9', '>') == 1)) + if (!(version_compare(PHP_VERSION, '6.0', '==') == 1)) mysqli_get_client_stats_assert_eq('non_result_set_queries', $new_info, $info, $test_counter); mysqli_get_client_stats_assert_eq('buffered_sets', $new_info, $info, $test_counter); mysqli_get_client_stats_assert_eq('unbuffered_sets', $new_info, $info, $test_counter); diff --git a/ext/mysqli/tests/mysqli_get_warnings.phpt b/ext/mysqli/tests/mysqli_get_warnings.phpt index a7370b7d30..0d5c768ece 100644 --- a/ext/mysqli/tests/mysqli_get_warnings.phpt +++ b/ext/mysqli/tests/mysqli_get_warnings.phpt @@ -129,8 +129,7 @@ if (!$TEST_EXPERIMENTAL) $warning = new mysqli_warning($mysqli); $i = 1; while ($warning->next() && ('' != ($tmp = $warning->message))) { - if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && - (version_compare(PHP_VERSION, '6.9.9', '<=') == 1) && + if ((version_compare(PHP_VERSION, '6.0', '==') == 1) && !is_unicode($tmp)) printf("[033a] Warning should have been a unicode string, got %s/%s", gettype($tmp), $tmp); $i++; diff --git a/ext/mysqli/tests/mysqli_info.phpt b/ext/mysqli/tests/mysqli_info.phpt index c8f78f4386..a1b8517588 100644 --- a/ext/mysqli/tests/mysqli_info.phpt +++ b/ext/mysqli/tests/mysqli_info.phpt @@ -30,8 +30,7 @@ require_once('skipifconnectfailure.inc'); if (!is_string($tmp = mysqli_info($link)) || ('' == $tmp)) printf("[006] Expecting string/any_non_empty, got %s/%s\n", gettype($tmp), $tmp); - if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && - (version_compare(PHP_VERSION, '6.9.9', '<=') == 1) && + if ((version_compare(PHP_VERSION, '6.0', '==') == 1) && !is_unicode($tmp)) printf("[007] Expecting unicode, because unicode mode it on. Got binary string\n"); diff --git a/ext/mysqli/tests/mysqli_query_unicode.phpt b/ext/mysqli/tests/mysqli_query_unicode.phpt index 478ccbd30f..5c33178f3c 100644 --- a/ext/mysqli/tests/mysqli_query_unicode.phpt +++ b/ext/mysqli/tests/mysqli_query_unicode.phpt @@ -88,7 +88,7 @@ mysqli_close($link); /* Trying to test what Ramil suggests in http://bugs.mysql.com/bug.php?id=29576 However, this won't work, because we're lacking MYSQLI_SET_CHARSET_NAME. - if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) { + if ((version_compare(PHP_VERSION, '6.0', '==') == 1)) { if (mysqli_get_server_version() > 50002) { @mysqli_query($link, "DROP USER IF EXISTS 'тест'@'%'"); if (TRUE !== mysqli_query($link, "CREATE USER 'тест'@'%'")) { diff --git a/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt b/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt index 2fd1121a76..ee84c86866 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt @@ -2,7 +2,7 @@ mysqli_real_escape_string() - gbk --SKIPIF-- ') == 1) { +if (version_compare(PHP_VERSION, '6.0', '==') == 1) { die('skip set character set not functional with PHP 6 (fomerly PHP 6 && unicode.semantics=On)'); } diff --git a/ext/mysqli/tests/mysqli_real_escape_string_sjis.phpt b/ext/mysqli/tests/mysqli_real_escape_string_sjis.phpt index 2ed2b8bf11..3fb2b7df25 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_sjis.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_sjis.phpt @@ -2,7 +2,7 @@ mysqli_real_escape_string() - sjis --SKIPIF-- ') == 1) { +if (version_compare(PHP_VERSION, '6.0', '==') == 1) { die('skip set character set not functional with PHP 6 (fomerly PHP 6 && unicode.semantics=On)'); } diff --git a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt index 9b96c4f4ec..3935365257 100644 --- a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt +++ b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt @@ -10,7 +10,7 @@ require_once('connect.inc'); if (!$IS_MYSQLND) die("skip Test for mysqlnd only"); -if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) +if ((version_compare(PHP_VERSION, '6.0', '==') == 1)) die("skip (TODO) PHP 6.0 has a difference debug_zval_dump output format"); ?> diff --git a/ext/mysqli/tests/mysqli_set_charset.phpt b/ext/mysqli/tests/mysqli_set_charset.phpt index 38fe56841b..997af96f94 100644 --- a/ext/mysqli/tests/mysqli_set_charset.phpt +++ b/ext/mysqli/tests/mysqli_set_charset.phpt @@ -6,7 +6,7 @@ require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('skipifconnectfailure.inc'); -if (version_compare(PHP_VERSION, '5.9.9', '>') == 1) { +if (version_compare(PHP_VERSION, '6.0', '==') == 1) { die('skip set character set not functional with PHP 6 (fomerly PHP 6 && unicode.semantics=On)'); } diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result.phpt index 553e71ab6b..c8910c1249 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result.phpt @@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc'); ') == 1) ? "unicode":"string"; + $hint_str_or_unicode = (version_compare(PHP_VERSION, '6.0', '==') == 1) ? "unicode":"string"; $tmp = NULL; $link = NULL; diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt index 724a32a787..643e9080c4 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt @@ -15,7 +15,7 @@ mysqli_stmt_get_result - data types if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); - $hint_str_or_unicode = (version_compare(PHP_VERSION, '5.9.9', '>') == 1) ? 'unicode' : 'string'; + $hint_str_or_unicode = (version_compare(PHP_VERSION, '6.0', '==') == 1) ? 'unicode' : 'string'; function func_mysqli_stmt_get_result($link, $engine, $bind_type, $sql_type, $bind_value, $offset, $type_hint = null) { diff --git a/ext/mysqli/tests/skipifunicode.inc b/ext/mysqli/tests/skipifunicode.inc index d453363d2e..89258d498e 100644 --- a/ext/mysqli/tests/skipifunicode.inc +++ b/ext/mysqli/tests/skipifunicode.inc @@ -1,5 +1,5 @@