]> granicus.if.org Git - php/commitdiff
MFH. Adapting (old) tests to current PHP 6 semantics - s/unicode.semantics test/versi...
authorUlf Wendel <uw@php.net>
Mon, 6 Jul 2009 15:08:13 +0000 (15:08 +0000)
committerUlf Wendel <uw@php.net>
Mon, 6 Jul 2009 15:08:13 +0000 (15:08 +0000)
ext/mysqli/tests/045.phpt
ext/mysqli/tests/mysqli_error_unicode.phpt
ext/mysqli/tests/mysqli_get_client_stats.phpt
ext/mysqli/tests/mysqli_get_warnings.phpt
ext/mysqli/tests/mysqli_query_unicode.phpt
ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt

index a1ef9ec40e24db1b873cc42edab1df19d614cd66..bae2ce8e2c8a4a5957ac15d1b9e156e6aa2ed089 100644 (file)
@@ -31,7 +31,7 @@ mysqli_bind_result (SHOW)
        mysqli_bind_result($stmt, $c1, $c2);
        mysqli_fetch($stmt);
        mysqli_stmt_close($stmt);
-       if (ini_get("unicode.semantics") && mysqli_get_server_version($link) < 50000) {
+       if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && mysqli_get_server_version($link) < 50000) {
                /* variables are binary */
                settype($c1, "unicode");
                settype($c2, "unicode");
index 09ab5a99923d935de0b347c9b75ad595041b37b3..8789f89e84647bdd3636e06c8b0625c6ae078b5a 100644 (file)
@@ -24,7 +24,7 @@ require_once('skipifconnectfailure.inc');
                        $host, $user, $db, $port, $socket);
        }
 
-       if (!ini_get("unicode.semantics")) {
+       if (!(version_compare(PHP_VERSION, '5.9.9', '>') == 1)) {
                mysqli_query($link, "set names utf8");
        }
 
index 26a1e76c739f22503b46dafde80efe5f96a34d3a..9c1a0c6714f0c0e9c6d915fb7ce9d265a50fe91a 100644 (file)
@@ -118,7 +118,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 (!ini_get("unicode.semantics"))
+       if (!(version_compare(PHP_VERSION, '5.9.9', '>') == 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);
index 661018be76943756404062165e1613626fccac4f..a8b632c67ae9a717faa6ac2edfd6d17f820a9f7a 100644 (file)
@@ -129,7 +129,7 @@ if (!$TEST_EXPERIMENTAL)
        $warning = new mysqli_warning($mysqli);
                $i = 1;
        while ($warning->next() && ('' != ($tmp = $warning->message))) {
-               if (ini_get('unicode.semantics') && !is_unicode($tmp))
+               if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($tmp))
                        printf("[033a] Warning should have been a unicode string, got %s/%s", gettype($tmp), $tmp);
                $i++;
        }
index c05f22a2f1649cb28b127a71f0e2e84bf16d4055..478ccbd30f740701e861cad235d8e144169e6f75 100644 (file)
@@ -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 (ini_get("unicode.semantics")) {
+       if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) {
                if (mysqli_get_server_version() > 50002) {
                        @mysqli_query($link, "DROP USER IF EXISTS 'тест'@'%'");
                        if (TRUE !== mysqli_query($link, "CREATE USER 'тест'@'%'")) {
index 9e69ce4f5738ee4554273759b997e6bb65682a52..ddcfdc8b87f747829f8e8d74c0ad31c6d02a4450 100644 (file)
@@ -42,7 +42,7 @@ mysqli.allow_local_infile=1
 
                printf("Callback: %d\n", $invocation++);
 
-               $num_chars = (ini_get('unicode.semantics')) ? (floor($buflen / 2) - 10) : ($buflen - 5);
+               $num_chars = (version_compare(PHP_VERSION, '5.9.9', '>') == 1) ? (floor($buflen / 2) - 10) : ($buflen - 5);
                $part1 = floor($num_chars / 2);
                $part2 = $num_chars - $part1;