uw Mon Jul 6 15:07:31 2009 UTC Modified files: /php-src/ext/mysqli/tests 045.phpt mysqli_error_unicode.phpt mysqli_get_client_stats.phpt mysqli_get_warnings.phpt mysqli_query_unicode.phpt mysqli_set_local_infile_handler_bad_character.phpt Log: Adapting (old) tests to current PHP 6 semantics - s/unicode.semantics test/version_compare http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/045.phpt?r1=1.13&r2=1.14&diff_format=u Index: php-src/ext/mysqli/tests/045.phpt diff -u php-src/ext/mysqli/tests/045.phpt:1.13 php-src/ext/mysqli/tests/045.phpt:1.14 --- php-src/ext/mysqli/tests/045.phpt:1.13 Thu May 28 14:11:40 2009 +++ php-src/ext/mysqli/tests/045.phpt Mon Jul 6 15:07:31 2009 @@ -31,7 +31,7 @@ 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"); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_error_unicode.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/mysqli/tests/mysqli_error_unicode.phpt diff -u php-src/ext/mysqli/tests/mysqli_error_unicode.phpt:1.4 php-src/ext/mysqli/tests/mysqli_error_unicode.phpt:1.5 --- php-src/ext/mysqli/tests/mysqli_error_unicode.phpt:1.4 Thu May 28 14:11:40 2009 +++ php-src/ext/mysqli/tests/mysqli_error_unicode.phpt Mon Jul 6 15:07:31 2009 @@ -24,7 +24,7 @@ $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"); } http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_client_stats.phpt?r1=1.9&r2=1.10&diff_format=u Index: php-src/ext/mysqli/tests/mysqli_get_client_stats.phpt diff -u php-src/ext/mysqli/tests/mysqli_get_client_stats.phpt:1.9 php-src/ext/mysqli/tests/mysqli_get_client_stats.phpt:1.10 --- php-src/ext/mysqli/tests/mysqli_get_client_stats.phpt:1.9 Mon Jul 6 14:36:52 2009 +++ php-src/ext/mysqli/tests/mysqli_get_client_stats.phpt Mon Jul 6 15:07:31 2009 @@ -118,7 +118,7 @@ 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); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_warnings.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/mysqli/tests/mysqli_get_warnings.phpt diff -u php-src/ext/mysqli/tests/mysqli_get_warnings.phpt:1.3 php-src/ext/mysqli/tests/mysqli_get_warnings.phpt:1.4 --- php-src/ext/mysqli/tests/mysqli_get_warnings.phpt:1.3 Mon Jul 6 14:36:52 2009 +++ php-src/ext/mysqli/tests/mysqli_get_warnings.phpt Mon Jul 6 15:07:31 2009 @@ -129,7 +129,7 @@ $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++; } http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_query_unicode.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/mysqli/tests/mysqli_query_unicode.phpt diff -u php-src/ext/mysqli/tests/mysqli_query_unicode.phpt:1.6 php-src/ext/mysqli/tests/mysqli_query_unicode.phpt:1.7 --- php-src/ext/mysqli/tests/mysqli_query_unicode.phpt:1.6 Thu May 28 15:47:08 2009 +++ php-src/ext/mysqli/tests/mysqli_query_unicode.phpt Mon Jul 6 15:07:31 2009 @@ -88,7 +88,7 @@ /* 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 'ÑеÑÑ'@'%'")) { http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt diff -u php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt:1.4 php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt:1.5 --- php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt:1.4 Mon Jul 6 14:36:52 2009 +++ php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt Mon Jul 6 15:07:31 2009 @@ -42,7 +42,7 @@ 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;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php