4 * Sort arrays using various locales.
8 ZendGoodExtIntlTestsCollatorSortWithSortKeysVariant2
::$test_num = 1;
11 * Sort arrays in the given list using specified locale.
13 function sort_arrays( $locale, $arrays )
17 $coll = ut_coll_create( $locale );
19 foreach( $arrays as $array )
22 $res_val = ut_coll_sort_with_sort_keys( $coll, inout
$array );
24 // Concatenate the sorted array and function result
25 // with output string.
26 $res_dump = "\n" . dump( $array ) .
27 "\n Result: " . dump( $res_val );
30 // Preppend test signature to output string
31 $md5 = md5( $res_dump );
35 "Test ".ZendGoodExtIntlTestsCollatorSortWithSortKeysVariant2
::$test_num.".$md5:" .
37 ++ZendGoodExtIntlTestsCollatorSortWithSortKeysVariant2
::$test_num;
47 ZendGoodExtIntlTestsCollatorSortWithSortKeysVariant2
::$test_num = 1;
50 // Sort an array in SORT_REGULAR mode using en_US locale.
52 array( 'abc', 'abd', 'aaa' ),
53 array( 'm' , '1' , '_' ),
54 array( 'a' , 'aaa', 'aa' ),
55 array( 'ba' , 'b' , 'ab' ),
56 array( 'e' , 'c' , 'a' ),
57 array( 'd' , '' , ' a' ),
58 array( 'd ' , 'f ' , ' a' ),
59 array( 'a' , null , '3' ),
60 array( 'y' , 'i' , 'k' )
63 $res_str .= sort_arrays( 'en_US', $test_params );
65 // Sort a non-ASCII array using ru_RU locale.
67 array( 'абг', 'абв', 'ааа', 'abc' ),
68 array( 'аа', 'ааа', 'а' )
71 $res_str .= sort_arrays( 'ru_RU', $test_params );
73 // Array with data for sorting.
75 array( 'y' , 'i' , 'k' )
78 // Sort an array using Lithuanian locale.
79 $res_str .= sort_arrays( 'lt_LT', $test_params );
81 return $res_str . "\n";
84 include_once( 'ut_common.inc' );
87 abstract final class ZendGoodExtIntlTestsCollatorSortWithSortKeysVariant2
{
88 public static $test_num;