4 * Sort associative arrays using various locales.
8 ZendGoodExtIntlTestsCollatorAsortVariant2
::$test_num = 1;
11 * Sort various arrays in specified locale.
13 function sort_arrays( $locale, $test_arrays, $sort_flag = Collator
::SORT_REGULAR
)
17 $coll = ut_coll_create( $locale );
19 foreach( $test_arrays as $test_array )
21 // Try to sort test data.
22 $res_val = ut_coll_asort( $coll, &$test_array, $sort_flag );
24 // Return output data.
25 $res_dump = "\n" . dump( $test_array ) .
26 "\n Result: " . dump( $res_val );
28 // Preppend test signature to output string
29 $md5 = md5( $res_dump );
33 "Test ".ZendGoodExtIntlTestsCollatorAsortVariant2
::$test_num.".$md5:" .
35 ++ZendGoodExtIntlTestsCollatorAsortVariant2
::$test_num;
47 ZendGoodExtIntlTestsCollatorAsortVariant2
::$test_num = 1;
50 // Sort an array in SORT_REGULAR mode using en_US locale.
78 $res_str .= sort_arrays( 'en_US', $test_params );
80 // Sort an array in SORT_STRING mode using en_US locale.
99 $res_str .= sort_arrays( 'en_US', $test_params, Collator
::SORT_STRING
);
101 // Sort a non-ASCII array using ru_RU locale.
102 $test_params = array(
113 $res_str .= sort_arrays( 'ru_RU', $test_params );
116 // Sort an array using Lithuanian locale.
117 $test_params = array(
123 $res_str .= sort_arrays( 'lt_LT', $test_params );
125 return $res_str . "\n";
128 include_once( 'ut_common.inc' );
131 abstract final class ZendGoodExtIntlTestsCollatorAsortVariant2
{
132 public static $test_num;