Patch fix-test-cases for intl Bug #64991
Patch version 2013-06-21 13:28 UTC
Return to Bug #64991 |
Download this patch
Patch Revisions:
Developer: jithin1987@gmail.com
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/bug58756_MessageFormatter_51+.phpt tests/bug58756_MessageFormatter_51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/bug58756_MessageFormatter_51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/bug58756_MessageFormatter_51+.phpt 2013-06-21 11:42:39.786810872 +0000
@@ -0,0 +1,36 @@
+--TEST--
+Bug #58756: w.r.t MessageFormatter
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled'); ?>
+
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+
+$time = 1247013673;
+
+ini_set('date.timezone', 'America/New_York');
+
+$msgf = new MessageFormatter('en_US', '{0,date,full} {0,time,h:m:s a V}');
+
+echo "date: " . date('l, F j, Y g:i:s A T', $time) . "\n";
+echo "msgf: " . $msgf->format(array($time)) . "\n";
+
+//NOT FIXED:
+/*$msgf = new MessageFormatter('en_US',
+'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
+
+echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
+ $msgf->format(array($time, 'time')), "\n";
+*/
+
+?>
+==DONE==
+--EXPECT--
+date: Tuesday, July 7, 2009 8:41:13 PM EDT
+msgf: Tuesday, July 7, 2009 8:41:13 PM usnyc
+==DONE==
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/bug58756_MessageFormatter.phpt tests/bug58756_MessageFormatter.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/bug58756_MessageFormatter.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/bug58756_MessageFormatter.phpt 2013-06-21 11:43:40.935751861 +0000
@@ -1,9 +1,11 @@
--TEST--
-Bug #58756: w.r.t MessageFormatter
+Bug #58756: w.r.t MessageFormatter icu < 51
--SKIPIF--
<?php
if (!extension_loaded('intl'))
- die('skip intl extension not enabled');
+ die('skip intl extension not enabled');?>
+
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
@@ -31,4 +33,4 @@
--EXPECT--
date: Tuesday, July 7, 2009 8:41:13 PM EDT
msgf: Tuesday, July 7, 2009 8:41:13 PM EDT
-==DONE==
\ No newline at end of file
+==DONE==
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_asort_51+.phpt tests/collator_asort_51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_asort_51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/collator_asort_51+.phpt 2013-06-21 11:48:04.717754022 +0000
@@ -0,0 +1,243 @@
+--TEST--
+asort() icu >=51
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+
+/*
+ * Sort associative arrays using various locales.
+ */
+
+
+$test_num = 1;
+
+/*
+ * Sort various arrays in specified locale.
+ */
+function sort_arrays( $locale, $test_arrays, $sort_flag = Collator::SORT_REGULAR )
+{
+ $res_str = '';
+
+ $coll = ut_coll_create( $locale );
+
+ foreach( $test_arrays as $test_array )
+ {
+ // Try to sort test data.
+ $res_val = ut_coll_asort( $coll, $test_array, $sort_flag );
+
+ // Return output data.
+ $res_dump = "\n" . dump( $test_array ) .
+ "\n Result: " . dump( $res_val );
+
+ // Preppend test signature to output string
+ $md5 = md5( $res_dump );
+
+ global $test_num;
+
+ $res_str .= "\n\n".
+ "Test $test_num.$md5:" .
+ $res_dump;
+ ++$test_num;
+ }
+
+ return $res_str;
+}
+
+/*
+ * Test main function.
+ */
+function ut_main()
+{
+ global $test_num;
+ $test_num = 1;
+ $res_str = '';
+
+ // Sort an array in SORT_REGULAR mode using en_US locale.
+ $test_params = array(
+ array( 'd' => 'y' ,
+ 'c' => 'i' ,
+ 'a' => 'k' ),
+
+ array( 'a' => 'a' ,
+ 'b' => 'aaa',
+ 'c' => 'aa' ),
+
+ array( 'a' => 'a' ,
+ 'aaa'=> 'a' ,
+ 'aa' => 'a' ),
+
+ array( '1' => 'abc',
+ '5' => '!' ,
+ '2' => null ,
+ '7' => '' ),
+
+ array( '1' => '100',
+ '2' => '25' ,
+ '3' => '36' ),
+
+ array( '1' => 5 ,
+ '2' => '30' ,
+ '3' => 2 )
+ );
+
+ $res_str .= sort_arrays( 'en_US', $test_params );
+
+ // Sort an array in SORT_STRING mode using en_US locale.
+ $test_params = array(
+ array( '1' => '100',
+ '2' => '25' ,
+ '3' => '36' ),
+
+ array( '1' => 5 ,
+ '2' => '30' ,
+ '3' => 2 ),
+
+ array( '1' => 'd' ,
+ '2' => '' ,
+ '3' => ' a' ),
+
+ array( '1' => 'y' ,
+ '2' => 'k' ,
+ '3' => 'i' )
+ );
+
+ $res_str .= sort_arrays( 'en_US', $test_params, Collator::SORT_STRING );
+
+ // Sort a non-ASCII array using ru_RU locale.
+ $test_params = array(
+ array( 'п' => 'у',
+ 'б' => 'в',
+ 'е' => 'а' ),
+
+ array( '1' => 'п',
+ '4' => '',
+ '7' => 'd',
+ '2' => 'пп' )
+ );
+
+ $res_str .= sort_arrays( 'ru_RU', $test_params );
+
+
+ // Sort an array using Lithuanian locale.
+ $test_params = array(
+ array( 'd' => 'y',
+ 'c' => 'i',
+ 'a' => 'k' )
+ );
+
+ $res_str .= sort_arrays( 'lt_LT', $test_params );
+
+ return $res_str . "\n";
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+?>
+--EXPECT--
+Test 1.162b81ac12878b817fc39063097e45b5:
+array (
+ 'c' => 'i',
+ 'a' => 'k',
+ 'd' => 'y',
+)
+ Result: true
+
+Test 2.93d96e22f692d8a281b0a389f01f8d1e:
+array (
+ 'a' => 'a',
+ 'c' => 'aa',
+ 'b' => 'aaa',
+)
+ Result: true
+
+Test 3.9f25de4482bc7b58de508e278113317c:
+array (
+ 'aa' => 'a',
+ 'aaa' => 'a',
+ 'a' => 'a',
+)
+ Result: true
+
+Test 4.a85a41ea78e45b651080cfd98c0b431d:
+array (
+ 7 => '',
+ 2 => NULL,
+ 5 => '!',
+ 1 => 'abc',
+)
+ Result: true
+
+Test 5.99dc71f405b286e03d489061b36e6900:
+array (
+ 2 => '25',
+ 3 => '36',
+ 1 => '100',
+)
+ Result: true
+
+Test 6.bf5bba243307c9d12934e756ad4be190:
+array (
+ 3 => 2,
+ 1 => 5,
+ 2 => '30',
+)
+ Result: true
+
+Test 7.e4ee7024c61476e9e7a6c28b5e47df6f:
+array (
+ 1 => '100',
+ 2 => '25',
+ 3 => '36',
+)
+ Result: true
+
+Test 8.5fa7033dd43784be0db1474eb48b83c8:
+array (
+ 3 => 2,
+ 2 => '30',
+ 1 => 5,
+)
+ Result: true
+
+Test 9.588cdf4692bc09aa92ffe7e48f9e4579:
+array (
+ 2 => '',
+ 3 => ' a',
+ 1 => 'd',
+)
+ Result: true
+
+Test 10.be02641a47ebcccd23e4183ca3a415f7:
+array (
+ 3 => 'i',
+ 2 => 'k',
+ 1 => 'y',
+)
+ Result: true
+
+Test 11.153d9b11d1e5936afc917a94a4e11f34:
+array (
+ 'е' => 'а',
+ 'б' => 'в',
+ 'п' => 'у',
+)
+ Result: true
+
+Test 12.e1f5cb037b564dce39ffbd0a61562d59:
+array (
+ 4 => '',
+ 1 => 'п',
+ 2 => 'пп',
+ 7 => 'd',
+)
+ Result: true
+
+Test 13.8800d48abb960a59002eef77f1d73ae0:
+array (
+ 'c' => 'i',
+ 'd' => 'y',
+ 'a' => 'k',
+)
+ Result: true
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_asort.phpt tests/collator_asort.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_asort.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/collator_asort.phpt 2013-06-21 11:47:34.171445402 +0000
@@ -1,7 +1,8 @@
--TEST--
-asort()
+asort() icu < 51
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_compare_51+.phpt tests/collator_compare_51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_compare_51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/collator_compare_51+.phpt 2013-06-21 11:51:22.374708063 +0000
@@ -0,0 +1,135 @@
+--TEST--
+compare() icu >=51
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+
+/*
+ * Compare various string pairs using various locales.
+ */
+
+
+/*
+ * Converts comparison result to a character.
+ */
+function cmp_to_char( $comp_res )
+{
+ switch( $comp_res )
+ {
+ case 0: // UCOL_EQUAL
+ return '=';
+ case 1: // UCOL_GREATER
+ return '>';
+ case -1: // UCOL_LESS
+ return '<';
+ default:
+ return '?';
+ }
+}
+
+/*
+ * Compare string pairs in the given array
+ * using specified locale.
+ */
+function compare_pairs( $locale, $test_array )
+{
+ $res_str = '';
+
+ $coll = ut_coll_create( $locale );
+
+ foreach( $test_array as $test_strings )
+ {
+ list( $str1, $str2 ) = $test_strings;
+
+ // Compare strings.
+ $res_val = cmp_to_char( ut_coll_compare( $coll, $str1, $str2 ) );
+
+ // Concatenate result strings.
+ $res_str .= dump( $str1 ) .
+ ' ' . $res_val . ' ' .
+ dump( $str2 ) . "\n";
+ }
+
+ return $res_str;
+
+}
+
+function ut_main()
+{
+ $res_str = '';
+
+ // Compare strings using en_US locale.
+ $test_params = array(
+ array( 'abc', 'abc' ),
+ array( 'Abc', 'abc' ),
+ array( 'a' , 'abc' ),
+ array( 'a' , '' ),
+ array( '' , '' ),
+ array( 'a' , 'b' ),
+ array( 'ab' , 'b' ),
+ array( 'ab' , 'a' ),
+ array( 123 , 'abc' ),
+ array( 'ac' , null ),
+ array( '.' , '.' ),
+ // Try to compare long strings.
+ array( 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcde',
+ 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdea'),
+ array( null , null )
+ );
+
+ $res_str .= compare_pairs( 'en_US', $test_params );
+
+
+ // Compare strings using ru_RU locale.
+ $test_params = array(
+ array( 'а', 'б' ),
+ array( 'а', 'аа' ),
+ array( 'аб', 'ба' ),
+ array( 'а', ',' ),
+ array( 'а', 'b' ),
+ array( 'а', 'bb' ),
+ array( 'а', 'ab' ),
+ array( 'а', null )
+ );
+
+ $res_str .= compare_pairs( 'ru_RU', $test_params );
+
+
+ // Compare strings using lt_LT locale.
+ $test_params = array(
+ array( 'y', 'k' )
+ );
+
+ $res_str .= compare_pairs( 'lt_LT', $test_params );
+
+ return $res_str;
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+?>
+--EXPECT--
+'abc' = 'abc'
+'Abc' > 'abc'
+'a' < 'abc'
+'a' > ''
+'' = ''
+'a' < 'b'
+'ab' < 'b'
+'ab' > 'a'
+123 < 'abc'
+'ac' > NULL
+'.' = '.'
+'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcde' < 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdea'
+NULL = NULL
+'а' < 'б'
+'а' < 'аа'
+'аб' < 'ба'
+'а' > ','
+'а' < 'b'
+'а' < 'bb'
+'а' < 'ab'
+'а' > NULL
+'y' < 'k'
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_compare.phpt tests/collator_compare.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_compare.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/collator_compare.phpt 2013-06-21 11:50:09.614703147 +0000
@@ -1,7 +1,8 @@
--TEST--
-compare()
+compare() icu < 51
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_get_sort_key_51+.phpt tests/collator_get_sort_key_51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_get_sort_key_51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/collator_get_sort_key_51+.phpt 2013-06-21 11:57:20.264755066 +0000
@@ -0,0 +1,99 @@
+--TEST--
+collator_get_sort_key() icu >= 51
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+
+/*
+ * Get sort keys using various locales
+ */
+function sort_arrays( $locale, $data )
+{
+ $res_str = '';
+
+ $coll = ut_coll_create( $locale );
+
+ foreach($data as $value) {
+ $res_val = ut_coll_get_sort_key( $coll, $value );
+ $res_str .= "source: ".$value."\n".
+ "key: ".bin2hex($res_val)."\n";
+ }
+
+ return $res_str;
+}
+
+
+function ut_main()
+{
+ $res_str = '';
+
+ // Regular strings keys
+ $test_params = array(
+ 'abc', 'abd', 'aaa',
+ 'аа', 'а', 'z',
+ '', null , '3',
+ 'y' , 'i' , 'k'
+ );
+
+ $res_str .= sort_arrays( 'en_US', $test_params );
+
+ // Sort a non-ASCII array using ru_RU locale.
+ $test_params = array(
+ 'абг', 'абв', 'жжж', 'эюя'
+ );
+
+ $res_str .= sort_arrays( 'ru_RU', $test_params );
+
+ // Sort an array using Lithuanian locale.
+ $res_str .= sort_arrays( 'lt_LT', $test_params );
+
+ return $res_str . "\n";
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+?>
+--EXPECT--
+source: abc
+key: 27292b01070107
+source: abd
+key: 27292d01070107
+source: aaa
+key: 27272701070107
+source: аа
+key: 5c0a0a01060106
+source: а
+key: 5c0a01050105
+source: z
+key: 5901050105
+source:
+key: 0101
+source:
+key: 0101
+source: 3
+key: 1801050105
+source: y
+key: 5701050105
+source: i
+key: 3701050105
+source: k
+key: 3b01050105
+source: абг
+key: 260a161a01070107
+source: абв
+key: 260a161801070107
+source: жжж
+key: 263a3a3a01070107
+source: эюя
+key: 273b3f4501070107
+source: абг
+key: 5c0a161a01070107
+source: абв
+key: 5c0a161801070107
+source: жжж
+key: 5c3a3a3a01070107
+source: эюя
+key: 5d3b3f4501070107
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_get_sort_key.phpt tests/collator_get_sort_key.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_get_sort_key.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/collator_get_sort_key.phpt 2013-06-21 11:52:49.893755024 +0000
@@ -1,8 +1,9 @@
--TEST--
-collator_get_sort_key()
+collator_get_sort_key() icu < 51
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
@@ -95,4 +96,4 @@
source: жжж
key: 5c3a3a3a01070107
source: эюя
-key: 5d3b3f4501070107
\ No newline at end of file
+key: 5d3b3f4501070107
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_sort_51+.phpt tests/collator_sort_51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_sort_51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/collator_sort_51+.phpt 2013-06-21 12:04:43.114754427 +0000
@@ -0,0 +1,248 @@
+--TEST--
+sort() icu >= 51
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+
+/*
+ * Sort arrays using various locales.
+ */
+
+
+$test_num = 1;
+
+/*
+ * Sort arrays in the given list using specified locale.
+ */
+function sort_arrays( $locale, $arrays, $sort_flag = Collator::SORT_REGULAR )
+{
+ $res_str = '';
+
+ $coll = ut_coll_create( $locale );
+
+ foreach( $arrays as $array )
+ {
+ // Sort array values
+ $res_val = ut_coll_sort( $coll, $array, $sort_flag );
+
+ // Concatenate the sorted array and function result
+ // with output string.
+ $res_dump = "\n" . dump( $array ) .
+ "\n Result: " . dump( $res_val );
+
+ // Preppend test signature to output string
+ $md5 = md5( $res_dump );
+
+ global $test_num;
+
+ $res_str .= "\n\n".
+ "Test $test_num.$md5:" .
+ $res_dump;
+ ++$test_num;
+ }
+
+ return $res_str;
+}
+
+function ut_main()
+{
+ global $test_num;
+ $test_num = 1;
+ $res_str = '';
+
+ // Sort an array in SORT_REGULAR mode using en_US locale.
+ $test_params = array(
+ array( 'abc', 'abd', 'aaa' ),
+ array( 'm' , '1' , '_' ),
+ array( 'a' , 'aaa', 'aa' ),
+ array( 'ba' , 'b' , 'ab' ),
+ array( 'e' , 'c' , 'a' ),
+ array( '100', '25' , '36' ),
+ array( 5 , '30' , 2 ),
+ array( 'd' , '' , ' a' ),
+ array( 'd ' , 'f ' , ' a' ),
+ array( 'a' , null , '3' ),
+ array( 'y' , 'k' , 'i' )
+ );
+
+ $res_str .= sort_arrays( 'en_US', $test_params );
+
+ $test_params = array(
+ array( '100', '25' , '36' ),
+ array( 5 , '30' , 2 ),
+ array( 'd' , '' , ' a' ),
+ array( 'y' , 'k' , 'i' )
+ );
+
+ // Sort in en_US locale with SORT_STRING flag
+ $res_str .= sort_arrays( 'en_US', $test_params, Collator::SORT_STRING );
+
+
+ // Sort a non-ASCII array using ru_RU locale.
+ $test_params = array(
+ array( 'абг', 'абв', 'ааа', 'abc' ),
+ array( 'аа', 'ааа' , 'а' )
+ );
+
+ $res_str .= sort_arrays( 'ru_RU', $test_params );
+
+ // Sort an array using Lithuanian locale.
+ $test_params = array(
+ array( 'y' , 'k' , 'i' )
+ );
+
+ $res_str .= sort_arrays( 'lt_LT', $test_params );
+
+ return $res_str;
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+?>
+--EXPECT--
+Test 1.e8f1cd28133d79ecd660002f1c660d0e:
+array (
+ 0 => 'aaa',
+ 1 => 'abc',
+ 2 => 'abd',
+)
+ Result: true
+
+Test 2.c2ded12173dd2996927378cae37eb275:
+array (
+ 0 => '_',
+ 1 => '1',
+ 2 => 'm',
+)
+ Result: true
+
+Test 3.54071c968d71cb98c5d379145f8d7d38:
+array (
+ 0 => 'a',
+ 1 => 'aa',
+ 2 => 'aaa',
+)
+ Result: true
+
+Test 4.19abe63d6f6dfef65b0e3c9ab4826b07:
+array (
+ 0 => 'ab',
+ 1 => 'b',
+ 2 => 'ba',
+)
+ Result: true
+
+Test 5.9a8dc0a9bc771368c2f1fc3d02754610:
+array (
+ 0 => 'a',
+ 1 => 'c',
+ 2 => 'e',
+)
+ Result: true
+
+Test 6.ab530b060e5e54a65bfb8b9f8fc61870:
+array (
+ 0 => '25',
+ 1 => '36',
+ 2 => '100',
+)
+ Result: true
+
+Test 7.0718dd838509017bded2ed307a6e785f:
+array (
+ 0 => 2,
+ 1 => 5,
+ 2 => '30',
+)
+ Result: true
+
+Test 8.923d65739c5219c634616ffd100a50e4:
+array (
+ 0 => '',
+ 1 => ' a',
+ 2 => 'd',
+)
+ Result: true
+
+Test 9.289bc2f28e87d3201ec9d7e8477ae1b0:
+array (
+ 0 => ' a',
+ 1 => 'd ',
+ 2 => 'f ',
+)
+ Result: true
+
+Test 10.de0fd958484f2377a645835d7fbcf124:
+array (
+ 0 => NULL,
+ 1 => '3',
+ 2 => 'a',
+)
+ Result: true
+
+Test 11.dd2b8f0adb37c45d528cad1a0cc0f361:
+array (
+ 0 => 'i',
+ 1 => 'k',
+ 2 => 'y',
+)
+ Result: true
+
+Test 12.1e6b4d6f7df9d4580317634ea46d8208:
+array (
+ 0 => '100',
+ 1 => '25',
+ 2 => '36',
+)
+ Result: true
+
+Test 13.cec115dc9850b98dfbdf102efa09e61b:
+array (
+ 0 => 2,
+ 1 => '30',
+ 2 => 5,
+)
+ Result: true
+
+Test 14.923d65739c5219c634616ffd100a50e4:
+array (
+ 0 => '',
+ 1 => ' a',
+ 2 => 'd',
+)
+ Result: true
+
+Test 15.dd2b8f0adb37c45d528cad1a0cc0f361:
+array (
+ 0 => 'i',
+ 1 => 'k',
+ 2 => 'y',
+)
+ Result: true
+
+Test 16.49056308afb2b800363c5baa735ed247:
+array (
+ 0 => 'ааа',
+ 1 => 'абв',
+ 2 => 'абг',
+ 3 => 'abc',
+)
+ Result: true
+
+Test 17.91480b10473a0c96a4cd6d88c23c577a:
+array (
+ 0 => 'а',
+ 1 => 'аа',
+ 2 => 'ааа',
+)
+ Result: true
+
+Test 18.fdd3fe3981476039164aa000bf9177f2:
+array (
+ 0 => 'i',
+ 1 => 'y',
+ 2 => 'k',
+)
+ Result: true
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_sort.phpt tests/collator_sort.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_sort.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/collator_sort.phpt 2013-06-21 11:58:42.458831615 +0000
@@ -1,7 +1,8 @@
--TEST--
-sort()
+sort() icu < 51
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_sort_with_sort_keys_51+.phpt tests/collator_sort_with_sort_keys_51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_sort_with_sort_keys_51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/collator_sort_with_sort_keys_51+.phpt 2013-06-21 12:08:45.719708617 +0000
@@ -0,0 +1,190 @@
+--TEST--
+sort_with_sort_keys() icu >= 51
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+
+/*
+ * Sort arrays using various locales.
+ */
+
+
+$test_num = 1;
+
+/*
+ * Sort arrays in the given list using specified locale.
+ */
+function sort_arrays( $locale, $arrays )
+{
+ $res_str = '';
+
+ $coll = ut_coll_create( $locale );
+
+ foreach( $arrays as $array )
+ {
+ // Sort array values
+ $res_val = ut_coll_sort_with_sort_keys( $coll, $array );
+
+ // Concatenate the sorted array and function result
+ // with output string.
+ $res_dump = "\n" . dump( $array ) .
+ "\n Result: " . dump( $res_val );
+
+
+ // Preppend test signature to output string
+ $md5 = md5( $res_dump );
+
+ global $test_num;
+
+ $res_str .= "\n\n".
+ "Test $test_num.$md5:" .
+ $res_dump;
+ ++$test_num;
+ }
+
+ return $res_str;
+}
+
+
+function ut_main()
+{
+ global $test_num;
+ $test_num = 1;
+ $res_str = '';
+
+ // Sort an array in SORT_REGULAR mode using en_US locale.
+ $test_params = array(
+ array( 'abc', 'abd', 'aaa' ),
+ array( 'm' , '1' , '_' ),
+ array( 'a' , 'aaa', 'aa' ),
+ array( 'ba' , 'b' , 'ab' ),
+ array( 'e' , 'c' , 'a' ),
+ array( 'd' , '' , ' a' ),
+ array( 'd ' , 'f ' , ' a' ),
+ array( 'a' , null , '3' ),
+ array( 'y' , 'i' , 'k' )
+ );
+
+ $res_str .= sort_arrays( 'en_US', $test_params );
+
+ // Sort a non-ASCII array using ru_RU locale.
+ $test_params = array(
+ array( 'абг', 'абв', 'ааа', 'abc' ),
+ array( 'аа', 'ааа', 'а' )
+ );
+
+ $res_str .= sort_arrays( 'ru_RU', $test_params );
+
+ // Array with data for sorting.
+ $test_params = array(
+ array( 'y' , 'i' , 'k' )
+ );
+
+ // Sort an array using Lithuanian locale.
+ $res_str .= sort_arrays( 'lt_LT', $test_params );
+
+ return $res_str . "\n";
+}
+
+include_once( 'ut_common.inc' );
+ut_run();
+?>
+--EXPECT--
+Test 1.e8f1cd28133d79ecd660002f1c660d0e:
+array (
+ 0 => 'aaa',
+ 1 => 'abc',
+ 2 => 'abd',
+)
+ Result: true
+
+Test 2.c2ded12173dd2996927378cae37eb275:
+array (
+ 0 => '_',
+ 1 => '1',
+ 2 => 'm',
+)
+ Result: true
+
+Test 3.54071c968d71cb98c5d379145f8d7d38:
+array (
+ 0 => 'a',
+ 1 => 'aa',
+ 2 => 'aaa',
+)
+ Result: true
+
+Test 4.19abe63d6f6dfef65b0e3c9ab4826b07:
+array (
+ 0 => 'ab',
+ 1 => 'b',
+ 2 => 'ba',
+)
+ Result: true
+
+Test 5.9a8dc0a9bc771368c2f1fc3d02754610:
+array (
+ 0 => 'a',
+ 1 => 'c',
+ 2 => 'e',
+)
+ Result: true
+
+Test 6.923d65739c5219c634616ffd100a50e4:
+array (
+ 0 => '',
+ 1 => ' a',
+ 2 => 'd',
+)
+ Result: true
+
+Test 7.289bc2f28e87d3201ec9d7e8477ae1b0:
+array (
+ 0 => ' a',
+ 1 => 'd ',
+ 2 => 'f ',
+)
+ Result: true
+
+Test 8.de0fd958484f2377a645835d7fbcf124:
+array (
+ 0 => NULL,
+ 1 => '3',
+ 2 => 'a',
+)
+ Result: true
+
+Test 9.dd2b8f0adb37c45d528cad1a0cc0f361:
+array (
+ 0 => 'i',
+ 1 => 'k',
+ 2 => 'y',
+)
+ Result: true
+
+Test 10.49056308afb2b800363c5baa735ed247:
+array (
+ 0 => 'ааа',
+ 1 => 'абв',
+ 2 => 'абг',
+ 3 => 'abc',
+)
+ Result: true
+
+Test 11.91480b10473a0c96a4cd6d88c23c577a:
+array (
+ 0 => 'а',
+ 1 => 'аа',
+ 2 => 'ааа',
+)
+ Result: true
+
+Test 12.fdd3fe3981476039164aa000bf9177f2:
+array (
+ 0 => 'i',
+ 1 => 'y',
+ 2 => 'k',
+)
+ Result: true
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/collator_sort_with_sort_keys.phpt tests/collator_sort_with_sort_keys.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/collator_sort_with_sort_keys.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/collator_sort_with_sort_keys.phpt 2013-06-21 12:05:38.419373069 +0000
@@ -1,7 +1,8 @@
--TEST--
-sort_with_sort_keys()
+sort_with_sort_keys() icu < 51
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_format_50+.phpt tests/dateformat_format_50+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_format_50+.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/dateformat_format_50+.phpt 2013-06-21 12:21:49.440328245 +0000
@@ -1,5 +1,5 @@
--TEST--
-datefmt_format_code() (5.3+, ICU >= 50)
+datefmt_format_code() (5.3+, ICU == 50)
--SKIPIF--
<?php
if (!extension_loaded('intl'))
@@ -7,7 +7,9 @@
if(!defined('PHP_VERSION_ID') || PHP_VERSION_ID<50300)
die("skip PHP5.3+ only");
if (version_compare(INTL_ICU_VERSION, '50', '<'))
- die('skip for ICU >= 50');
+ die('skip for ICU == 50');
+ if (version_compare(INTL_ICU_VERSION, '50', '>'))
+ die('skip for ICU == 50');
--FILE--
<?php
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_format_51+.phpt tests/dateformat_format_51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_format_51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/dateformat_format_51+.phpt 2013-06-21 12:27:37.874105042 +0000
@@ -0,0 +1,428 @@
+--TEST--
+datefmt_format_code() (5.3+, ICU >= 51)
+--SKIPIF--
+<?php
+ if (!extension_loaded('intl'))
+ die('skip');
+ if(!defined('PHP_VERSION_ID') || PHP_VERSION_ID<50300)
+ die("skip PHP5.3+ only");
+ if (version_compare(INTL_ICU_VERSION, '50', '<'))
+ die('skip for ICU >= 51');
+--FILE--
+<?php
+
+//ini_set("intl.error_level", E_WARNING);
+
+/*
+ * Test for the datefmt_format function
+ */
+
+
+function ut_main()
+{
+ $timezone = 'GMT-10:00';
+
+ $locale_arr = array (
+ 'en_US'
+ );
+
+ $datetype_arr = array (
+ IntlDateFormatter::FULL,
+ IntlDateFormatter::LONG,
+ IntlDateFormatter::MEDIUM,
+ IntlDateFormatter::SHORT,
+ IntlDateFormatter::NONE
+ );
+
+ $res_str = '';
+
+
+ $time_arr = array (
+ 0,
+ -1200000,
+ 1200000,
+ 2200000000.0,
+ -2200000000.0,
+ 90099999,
+ 3600,
+ -3600
+ );
+
+ $localtime_arr1 = array (
+ 'tm_sec' => 24 ,
+ 'tm_min' => 3,
+ 'tm_hour' => 19,
+ 'tm_mday' => 3,
+ 'tm_mon' => 3,
+ 'tm_year' => 105,
+ );
+ $localtime_arr2 = array (
+ 'tm_sec' => 21,
+ 'tm_min' => 5,
+ 'tm_hour' => 7,
+ 'tm_mday' => 13,
+ 'tm_mon' => 4,
+ 'tm_year' => 205,
+ );
+ $localtime_arr3 = array (
+ 'tm_sec' => 11,
+ 'tm_min' => 13,
+ 'tm_hour' => 0,
+ 'tm_mday' => 17,
+ 'tm_mon' => 11,
+ 'tm_year' => -5
+ );
+
+ $localtime_arr = array (
+ $localtime_arr1,
+ $localtime_arr2,
+ $localtime_arr3
+ );
+
+ $d1 = new DateTime("2010-01-01 01:02:03", new DateTimeZone("UTC"));
+ $d2 = new DateTime("2000-12-31 03:04:05", new DateTimeZone("UTC"));
+ $d2->setTimezone(new DateTimeZone("PDT"));
+ $dates = array(
+ $d1,
+ $d2,
+ new StdClass(),
+ );
+
+ //Test format with input as a timestamp : integer
+ foreach( $time_arr as $timestamp_entry){
+ $res_str .= "\n------------\n";
+ $res_str .= "\nInput timestamp is : $timestamp_entry";
+ $res_str .= "\n------------\n";
+ foreach( $locale_arr as $locale_entry ){
+ foreach( $datetype_arr as $datetype_entry )
+ {
+ $res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry ";
+ $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN);
+ $formatted = ut_datefmt_format( $fmt , $timestamp_entry);
+ $res_str .= "\nFormatted timestamp is : $formatted";
+ }
+ }
+ }
+
+ //Test format with input as a localtime :array
+ foreach( $localtime_arr as $localtime_entry){
+ $res_str .= "\n------------\n";
+ $res_str .= "\nInput localtime is : ";
+ foreach( $localtime_entry as $key => $value){
+ $res_str .= "$key : '$value' , ";
+ }
+
+ $res_str .= "\n------------\n";
+ foreach( $locale_arr as $locale_entry ){
+ foreach( $datetype_arr as $datetype_entry )
+ {
+ $res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry ";
+ $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN );
+ $formatted1 = ut_datefmt_format( $fmt , $localtime_entry);
+ if( intl_get_error_code() == U_ZERO_ERROR){
+ $res_str .= "\nFormatted localtime_array is : $formatted1";
+ }else{
+ $res_str .= "\nError while formatting as: '".intl_get_error_message()."'";
+ }
+ }
+ }
+ }
+
+ foreach($dates as $date_entry) {
+ foreach( $locale_arr as $locale_entry ){
+ foreach( $datetype_arr as $datetype_entry ) {
+ $res_str .= "\n------------";
+ $res_str .= "\nDate is: ".var_export($date_entry, true);
+ $res_str .= "\n------------";
+
+ $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN );
+ $formatted1 = ut_datefmt_format( $fmt , $date_entry);
+ if( intl_get_error_code() == U_ZERO_ERROR){
+ $res_str .= "\nFormatted DateTime is : $formatted1";
+ }else{
+ $res_str .= "\nError while formatting as: '".intl_get_error_message()."'";
+ }
+ }
+ }
+ }
+
+ return $res_str;
+
+}
+
+include_once( 'ut_common.inc' );
+
+// Run the test
+ut_run();
+?>
+--EXPECT--
+------------
+
+Input timestamp is : 0
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Wednesday, December 31, 1969 at 2:00:00 PM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : December 31, 1969 at 2:00:00 PM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Dec 31, 1969, 2:00:00 PM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted timestamp is : 12/31/69, 2:00 PM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted timestamp is : 19691231 02:00 PM
+------------
+
+Input timestamp is : -1200000
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Wednesday, December 17, 1969 at 4:40:00 PM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : December 17, 1969 at 4:40:00 PM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Dec 17, 1969, 4:40:00 PM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted timestamp is : 12/17/69, 4:40 PM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted timestamp is : 19691217 04:40 PM
+------------
+
+Input timestamp is : 1200000
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Wednesday, January 14, 1970 at 11:20:00 AM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : January 14, 1970 at 11:20:00 AM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Jan 14, 1970, 11:20:00 AM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted timestamp is : 1/14/70, 11:20 AM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted timestamp is : 19700114 11:20 AM
+------------
+
+Input timestamp is : 2200000000
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Sunday, September 18, 2039 at 1:06:40 PM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : September 18, 2039 at 1:06:40 PM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Sep 18, 2039, 1:06:40 PM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted timestamp is : 9/18/39, 1:06 PM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted timestamp is : 20390918 01:06 PM
+------------
+
+Input timestamp is : -2200000000
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Saturday, April 14, 1900 at 2:53:20 PM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : April 14, 1900 at 2:53:20 PM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Apr 14, 1900, 2:53:20 PM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted timestamp is : 4/14/00, 2:53 PM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted timestamp is : 19000414 02:53 PM
+------------
+
+Input timestamp is : 90099999
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Wednesday, November 8, 1972 at 9:46:39 AM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : November 8, 1972 at 9:46:39 AM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Nov 8, 1972, 9:46:39 AM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted timestamp is : 11/8/72, 9:46 AM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted timestamp is : 19721108 09:46 AM
+------------
+
+Input timestamp is : 3600
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Wednesday, December 31, 1969 at 3:00:00 PM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : December 31, 1969 at 3:00:00 PM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Dec 31, 1969, 3:00:00 PM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted timestamp is : 12/31/69, 3:00 PM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted timestamp is : 19691231 03:00 PM
+------------
+
+Input timestamp is : -3600
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Wednesday, December 31, 1969 at 1:00:00 PM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : December 31, 1969 at 1:00:00 PM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Dec 31, 1969, 1:00:00 PM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted timestamp is : 12/31/69, 1:00 PM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted timestamp is : 19691231 01:00 PM
+------------
+
+Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_mday : '3' , tm_mon : '3' , tm_year : '105' ,
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted localtime_array is : Sunday, April 3, 2005 at 7:03:24 PM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted localtime_array is : April 3, 2005 at 7:03:24 PM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted localtime_array is : Apr 3, 2005, 7:03:24 PM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted localtime_array is : 4/3/05, 7:03 PM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted localtime_array is : 20050403 07:03 PM
+------------
+
+Input localtime is : tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_mday : '13' , tm_mon : '4' , tm_year : '205' ,
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted localtime_array is : Wednesday, May 13, 2105 at 7:05:21 AM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted localtime_array is : May 13, 2105 at 7:05:21 AM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted localtime_array is : May 13, 2105, 7:05:21 AM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted localtime_array is : 5/13/05, 7:05 AM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted localtime_array is : 21050513 07:05 AM
+------------
+
+Input localtime is : tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_mday : '17' , tm_mon : '11' , tm_year : '-5' ,
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted localtime_array is : Tuesday, December 17, 1895 at 12:13:11 AM GMT-10:00
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted localtime_array is : December 17, 1895 at 12:13:11 AM GMT-10
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted localtime_array is : Dec 17, 1895, 12:13:11 AM
+IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
+Formatted localtime_array is : 12/17/95, 12:13 AM
+IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
+Formatted localtime_array is : 18951217 12:13 AM
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2010-01-01 01:02:03',
+ 'timezone_type' => 3,
+ 'timezone' => 'UTC',
+))
+------------
+Formatted DateTime is : Thursday, December 31, 2009 at 3:02:03 PM GMT-10:00
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2010-01-01 01:02:03',
+ 'timezone_type' => 3,
+ 'timezone' => 'UTC',
+))
+------------
+Formatted DateTime is : December 31, 2009 at 3:02:03 PM GMT-10
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2010-01-01 01:02:03',
+ 'timezone_type' => 3,
+ 'timezone' => 'UTC',
+))
+------------
+Formatted DateTime is : Dec 31, 2009, 3:02:03 PM
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2010-01-01 01:02:03',
+ 'timezone_type' => 3,
+ 'timezone' => 'UTC',
+))
+------------
+Formatted DateTime is : 12/31/09, 3:02 PM
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2010-01-01 01:02:03',
+ 'timezone_type' => 3,
+ 'timezone' => 'UTC',
+))
+------------
+Formatted DateTime is : 20091231 03:02 PM
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2000-12-30 19:04:05',
+ 'timezone_type' => 3,
+ 'timezone' => 'America/Los_Angeles',
+))
+------------
+Formatted DateTime is : Saturday, December 30, 2000 at 5:04:05 PM GMT-10:00
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2000-12-30 19:04:05',
+ 'timezone_type' => 3,
+ 'timezone' => 'America/Los_Angeles',
+))
+------------
+Formatted DateTime is : December 30, 2000 at 5:04:05 PM GMT-10
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2000-12-30 19:04:05',
+ 'timezone_type' => 3,
+ 'timezone' => 'America/Los_Angeles',
+))
+------------
+Formatted DateTime is : Dec 30, 2000, 5:04:05 PM
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2000-12-30 19:04:05',
+ 'timezone_type' => 3,
+ 'timezone' => 'America/Los_Angeles',
+))
+------------
+Formatted DateTime is : 12/30/00, 5:04 PM
+------------
+Date is: DateTime::__set_state(array(
+ 'date' => '2000-12-30 19:04:05',
+ 'timezone_type' => 3,
+ 'timezone' => 'America/Los_Angeles',
+))
+------------
+Formatted DateTime is : 20001230 05:04 PM
+------------
+Date is: stdClass::__set_state(array(
+))
+------------
+Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
+------------
+Date is: stdClass::__set_state(array(
+))
+------------
+Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
+------------
+Date is: stdClass::__set_state(array(
+))
+------------
+Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
+------------
+Date is: stdClass::__set_state(array(
+))
+------------
+Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
+------------
+Date is: stdClass::__set_state(array(
+))
+------------
+Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_formatObject_calendar_51.phpt tests/dateformat_formatObject_calendar_51.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_formatObject_calendar_51.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/dateformat_formatObject_calendar_51.phpt 2013-06-21 12:12:50.254755036 +0000
@@ -0,0 +1,41 @@
+--TEST--
+IntlDateFormatter::formatObject(): IntlCalendar tests icu >=51
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled');?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", "Europe/Lisbon");
+
+$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon
+echo IntlDateFormatter::formatObject($cal), "\n";
+echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n";
+echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n";
+echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
+echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
+
+$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00');
+echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n";
+
+$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil');
+$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.);
+echo IntlDateFormatter::formatObject($cal), "\n";
+echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n";
+
+?>
+==DONE==
+
+--EXPECTF--
+01/01/2012%S 00:00:00
+Domingo, 1 de Janeiro de 2012 %S0:00:00 Hora %Sda Europa Ocidental
+Jan 1, 2012%S 12:00:00 AM
+1/1/12%S 12:00:00 AM Western European %STime
+Sun 2012-01-1 00,00,00.000 Portugal Time
+Domingo, 1 de Janeiro de 2012 %S5:00:00 GMT+03:00
+06/02/1433%S 00:00:00
+Sunday, Safar 6, 1433 %S12:00:00 AM Western European %STime
+==DONE==
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_formatObject_calendar.phpt tests/dateformat_formatObject_calendar.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_formatObject_calendar.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/dateformat_formatObject_calendar.phpt 2013-06-21 12:11:39.431000250 +0000
@@ -1,9 +1,11 @@
--TEST--
-IntlDateFormatter::formatObject(): IntlCalendar tests
+IntlDateFormatter::formatObject(): IntlCalendar tests icu < 51
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
+?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_formatObject_datetime_51.phpt tests/dateformat_formatObject_datetime_51.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_formatObject_datetime_51.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/dateformat_formatObject_datetime_51.phpt 2013-06-21 12:16:42.129754638 +0000
@@ -0,0 +1,34 @@
+--TEST--
+IntlDateFormatter::formatObject(): DateTime tests icu >= 51
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled');?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", "Europe/Lisbon");
+
+$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon
+echo IntlDateFormatter::formatObject($dt), "\n";
+echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
+echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n";
+echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
+echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
+
+$dt = new DateTime('2012-01-01 05:00:00+03:00');
+echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
+
+?>
+==DONE==
+
+--EXPECTF--
+01/01/2012%S 00:00:00
+Domingo, 1 de Janeiro de 2012 %S0:00:00 Hora %Sda Europa Ocidental
+Jan 1, 2012%S 12:00:00 AM
+1/1/12%S 12:00:00 AM Western European %STime
+Sun 2012-01-1 00,00,00.000 Portugal Time
+Domingo, 1 de Janeiro de 2012 %S5:00:00 GMT+03:00
+==DONE==
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_formatObject_datetime.phpt tests/dateformat_formatObject_datetime.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_formatObject_datetime.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/dateformat_formatObject_datetime.phpt 2013-06-21 12:14:33.664949190 +0000
@@ -1,9 +1,10 @@
--TEST--
-IntlDateFormatter::formatObject(): DateTime tests
+IntlDateFormatter::formatObject(): DateTime tests icu < 51
--SKIPIF--
<?php
if (!extension_loaded('intl'))
- die('skip intl extension not enabled');
+ die('skip intl extension not enabled');?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_format_parse_50+.phpt tests/dateformat_format_parse_50+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_format_parse_50+.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/dateformat_format_parse_50+.phpt 2013-06-21 12:29:13.061912704 +0000
@@ -1,10 +1,12 @@
--TEST--
-datefmt_format_code() and datefmt_parse_code() (ICU >= 50)
+datefmt_format_code() and datefmt_parse_code() (ICU == 50)
--SKIPIF--
<?php
if( !extension_loaded( 'intl' ) ) print 'skip';
if (version_compare(INTL_ICU_VERSION, '50', '<'))
- die('skip for ICU >= 50');
+ die('skip for ICU == 50');
+ if (version_compare(INTL_ICU_VERSION, '51', '>'))
+ die('skip for ICU == 50');
--FILE--
<?php
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_format_parse_51+.phpt tests/dateformat_format_parse_51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/dateformat_format_parse_51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/dateformat_format_parse_51+.phpt 2013-06-21 12:32:05.650753647 +0000
@@ -0,0 +1,297 @@
+--TEST--
+datefmt_format_code() and datefmt_parse_code() (ICU >= 51)
+--SKIPIF--
+<?php
+ if( !extension_loaded( 'intl' ) ) print 'skip';
+ if (version_compare(INTL_ICU_VERSION, '51', '<'))
+ die('skip for ICU >= 51');
+--FILE--
+<?php
+
+/*
+ * Test for the datefmt_format function
+ */
+
+
+function ut_main()
+{
+ $timezone = 'GMT+05:00';
+
+ $locale_arr = array (
+ 'en_US'
+ );
+
+ $datetype_arr = array (
+ IntlDateFormatter::FULL,
+ IntlDateFormatter::LONG,
+ IntlDateFormatter::MEDIUM
+ );
+
+ $res_str = '';
+
+
+ $time_arr = array (
+ 0,
+ -1200000,
+ 1200000,
+ 2200000000,
+ -2200000000,
+ 90099999,
+ 3600,
+ -3600
+ );
+
+ $localtime_arr1 = array (
+ 'tm_sec' => 24 ,
+ 'tm_min' => 3,
+ 'tm_hour' => 19,
+ 'tm_mday' => 3,
+ 'tm_mon' => 3,
+ 'tm_year' => 105,
+ );
+ $localtime_arr2 = array (
+ 'tm_sec' => 21,
+ 'tm_min' => 5,
+ 'tm_hour' => 7,
+ 'tm_mday' => 13,
+ 'tm_mon' => 7,
+ 'tm_year' => 205,
+ );
+ $localtime_arr3 = array (
+ 'tm_sec' => 11,
+ 'tm_min' => 13,
+ 'tm_hour' => 0,
+ 'tm_mday' => 17,
+ 'tm_mon' => 11,
+ 'tm_year' => -5
+ );
+
+ $localtime_arr = array (
+ $localtime_arr1,
+ $localtime_arr2,
+ $localtime_arr3
+ );
+
+ //Test format and parse with a timestamp : long
+ foreach( $time_arr as $timestamp_entry){
+ $res_str .= "\n------------\n";
+ $res_str .= "\nInput timestamp is : $timestamp_entry";
+ $res_str .= "\n------------\n";
+ foreach( $locale_arr as $locale_entry ){
+ foreach( $datetype_arr as $datetype_entry ) {
+ $res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry ";
+ $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry,$timezone);
+ $formatted = ut_datefmt_format( $fmt , $timestamp_entry);
+ $res_str .= "\nFormatted timestamp is : $formatted";
+ $parsed = ut_datefmt_parse( $fmt , $formatted);
+ if( intl_get_error_code() == U_ZERO_ERROR){
+ $res_str .= "\nParsed timestamp is : $parsed";
+ }else{
+ $res_str .= "\nError while parsing as: '".intl_get_error_message()."'";
+ }
+ }
+ }
+ }
+
+ //Test format and parse with a localtime :array
+ foreach( $localtime_arr as $localtime_entry){
+ $res_str .= "\n------------\n";
+ $res_str .= "\nInput localtime is : ";
+ foreach( $localtime_entry as $key => $value){
+ $res_str .= "$key : '$value' , ";
+ }
+
+ $res_str .= "\n------------\n";
+ foreach( $locale_arr as $locale_entry ){
+ foreach( $datetype_arr as $datetype_entry ) {
+ $res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry ";
+ $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry,$timezone);
+ $formatted1 = ut_datefmt_format( $fmt , $localtime_entry);
+ if( intl_get_error_code() == U_ZERO_ERROR){
+ $res_str .= "\nFormatted localtime_array is : $formatted1";
+ }else{
+ $res_str .= "\nError while formatting as: '".intl_get_error_message()."'";
+ }
+ //Parsing
+ $parsed_arr = ut_datefmt_localtime( $fmt, $formatted1 );
+
+ if( $parsed_arr){
+ $res_str .= "\nParsed array is: ";
+ foreach( $parsed_arr as $key => $value){
+ $res_str .= "$key : '$value' , ";
+ }
+ }
+/*
+ else{
+ //$res_str .= "No values found from LocaleTime parsing.";
+ $res_str .= "\tError : '".intl_get_error_message()."'";
+ }
+*/
+ }
+ }
+ }
+
+ return $res_str;
+
+}
+
+include_once( 'ut_common.inc' );
+
+// Run the test
+ut_run();
+?>
+--EXPECT--
+------------
+
+Input timestamp is : 0
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Thursday, January 1, 1970 at 5:00:00 AM GMT+05:00
+Parsed timestamp is : 0
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : January 1, 1970 at 5:00:00 AM GMT+5
+Parsed timestamp is : 0
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Jan 1, 1970, 5:00:00 AM
+Parsed timestamp is : 0
+------------
+
+Input timestamp is : -1200000
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Thursday, December 18, 1969 at 7:40:00 AM GMT+05:00
+Parsed timestamp is : -1200000
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : December 18, 1969 at 7:40:00 AM GMT+5
+Parsed timestamp is : -1200000
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Dec 18, 1969, 7:40:00 AM
+Parsed timestamp is : -1200000
+------------
+
+Input timestamp is : 1200000
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Thursday, January 15, 1970 at 2:20:00 AM GMT+05:00
+Parsed timestamp is : 1200000
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : January 15, 1970 at 2:20:00 AM GMT+5
+Parsed timestamp is : 1200000
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Jan 15, 1970, 2:20:00 AM
+Parsed timestamp is : 1200000
+------------
+
+Input timestamp is : 2200000000
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Monday, September 19, 2039 at 4:06:40 AM GMT+05:00
+Parsed timestamp is : 2200000000
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : September 19, 2039 at 4:06:40 AM GMT+5
+Parsed timestamp is : 2200000000
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Sep 19, 2039, 4:06:40 AM
+Parsed timestamp is : 2200000000
+------------
+
+Input timestamp is : -2200000000
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Sunday, April 15, 1900 at 5:53:20 AM GMT+05:00
+Parsed timestamp is : -2200000000
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : April 15, 1900 at 5:53:20 AM GMT+5
+Parsed timestamp is : -2200000000
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Apr 15, 1900, 5:53:20 AM
+Parsed timestamp is : -2200000000
+------------
+
+Input timestamp is : 90099999
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Thursday, November 9, 1972 at 12:46:39 AM GMT+05:00
+Parsed timestamp is : 90099999
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : November 9, 1972 at 12:46:39 AM GMT+5
+Parsed timestamp is : 90099999
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Nov 9, 1972, 12:46:39 AM
+Parsed timestamp is : 90099999
+------------
+
+Input timestamp is : 3600
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Thursday, January 1, 1970 at 6:00:00 AM GMT+05:00
+Parsed timestamp is : 3600
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : January 1, 1970 at 6:00:00 AM GMT+5
+Parsed timestamp is : 3600
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Jan 1, 1970, 6:00:00 AM
+Parsed timestamp is : 3600
+------------
+
+Input timestamp is : -3600
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted timestamp is : Thursday, January 1, 1970 at 4:00:00 AM GMT+05:00
+Parsed timestamp is : -3600
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted timestamp is : January 1, 1970 at 4:00:00 AM GMT+5
+Parsed timestamp is : -3600
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted timestamp is : Jan 1, 1970, 4:00:00 AM
+Parsed timestamp is : -3600
+------------
+
+Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_mday : '3' , tm_mon : '3' , tm_year : '105' ,
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted localtime_array is : Sunday, April 3, 2005 at 7:03:24 PM GMT+05:00
+Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' ,
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted localtime_array is : April 3, 2005 at 7:03:24 PM GMT+5
+Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' ,
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted localtime_array is : Apr 3, 2005, 7:03:24 PM
+Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' ,
+------------
+
+Input localtime is : tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_mday : '13' , tm_mon : '7' , tm_year : '205' ,
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted localtime_array is : Thursday, August 13, 2105 at 7:05:21 AM GMT+05:00
+Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' ,
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted localtime_array is : August 13, 2105 at 7:05:21 AM GMT+5
+Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' ,
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted localtime_array is : Aug 13, 2105, 7:05:21 AM
+Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' ,
+------------
+
+Input localtime is : tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_mday : '17' , tm_mon : '11' , tm_year : '-5' ,
+------------
+
+IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
+Formatted localtime_array is : Tuesday, December 17, 1895 at 12:13:11 AM GMT+05:00
+Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' ,
+IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
+Formatted localtime_array is : December 17, 1895 at 12:13:11 AM GMT+5
+Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' ,
+IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
+Formatted localtime_array is : Dec 17, 1895, 12:13:11 AM
+Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' ,
Common subdirectories: ../../vendor/php_intl_pecl-3.0.0/tests/_files and tests/_files
Binary files ../../vendor/php_intl_pecl-3.0.0/tests/.locale_get_display_name_50+.phpt.swp and tests/.locale_get_display_name_50+.phpt.swp differ
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/Makefile tests/Makefile
--- ../../vendor/php_intl_pecl-3.0.0/tests/Makefile 1970-01-01 00:00:00.000000000 +0000
+++ tests/Makefile 2013-06-06 03:50:23.000000000 +0000
@@ -0,0 +1,98 @@
+.PHONY: secondary run_test prepare_env install_timezone install_php_timezone install_phpunit help
+
+BY_USER_KEY ?= appre.by.user
+BY_PASSWD_KEY ?= appre.by.passwd
+
+secondary: run_test upload_results
+ @echo "End of Test"
+
+help:
+ @echo "the following targets are supported:"
+ @echo " help: show this info"
+ @echo " func-test: run the functional test, for both 32 and 64 bits"
+ @echo " unit32: run the unit test, for 32 bits only"
+ @echo " unit64: run the unit test, for 64 bits only"
+ @echo " install_icu: get yicu from hudson and install it"
+ @echo " install_php_icu: get yphp_intl from hudson and install it"
+
+func-test:
+ -@(export LANG=en_US.UTF-8 && export TZ=US/Pacific && $(MAKE) sub-unit)
+
+sub-unit:
+ $(MAKE) unit32
+ $(MAKE) unit64
+
+unit32:
+ -@echo "Running tests with LANG="$$LANG", LC_ALL="$$LC_ALL", and TZ="$$TZ with php32
+ @(export RUN_PHPUNIT="/home/y/bin/php /home/y/bin/phpunit" && $(MAKE) unit-base)
+
+unit64:
+ -@echo "Running tests with with php64"
+ @if [ -e /home/y/bin64/php ] ; then \
+ (export RUN_PHPUNIT="/home/y/bin64/php /home/y/bin/phpunit" && $(MAKE) unit-base) \
+ else \
+ echo "no php64 available" ; \
+ fi
+
+
+
+unit-base:
+ ($(RUN_PHPUNIT) --log-junit results_raw.xml yphpIntlTest.php && \
+( (echo -e "\n\n\nGoing to run functional test against bidi detection\n" && ${RUN_PHPUNIT} --log-junit results_bidi.xml bidiTest.php) && \
+ (echo -e "\n\nGoing to run functional test against date format\n" && $(RUN_PHPUNIT) --log-junit results_dateformat.xml dateformatTest.php) && \
+ (echo -e "\n\nGoing to run functional test against grapheme\n" && $(RUN_PHPUNIT) --log-junit results_grapheme.xml graphemeTest.php) && \
+ (echo -e "\n\nGoing to run functional test against locale\n" && $(RUN_PHPUNIT) --log-junit results_locale.xml localeTest.php) && \
+ (echo -e "\n\nGoing to run functional test against collator\n" && $(RUN_PHPUNIT) --log-junit results_collator.xml collatorTest.php) && \
+ (echo -e "\n\nGoing to run functional test against message formatter\n" && $(RUN_PHPUNIT) --log-junit results_msgFmtr.xml msgFmtrTest.php) ) \
+)
+
+config_run_test:
+ ( yinst set yphp_devel_overrides.open_basedir_add=/home/y/var/builds/:/home/y/bin/:./ && cd tests && $(MAKE) func-test )
+
+run_test: prepare_env install_icu install_php_icu install_phpunit config_run_test
+ @echo End of test
+
+prepare_env:
+ -@rm -rf pkgs; mkdir pkgs;
+
+install_icu:
+ rm -f ./pkgs/*
+ @echo "Getting the packages from Hudson..."
+ if [ ! -z "$(JOB_URL)" ]; then \
+ if [ ! -f /home/y/conf/keydb/appre.keys.keydb ]; then \
+ yinst activate appre_keys; \
+ if [ $$? -eq 0 ]; then \
+ export KEYS_ACTIVATED=1; \
+ fi; \
+ fi; \
+ export "HUDSON_USER=--user-key $(BY_USER_KEY)"; \
+ export "HUDSON_PASSWD=--password-key $(BY_PASSWD_KEY)"; \
+ fi; \
+ scrape-hudson $$HUDSON_USER $$HUDSON_PASSWD -v -o ./pkgs -h=http://hudson.appre.corp.sp1.yahoo.com:9999/yhudson --job I18nLibs-YICU-RHEL-Trunk-Commit
+ yinst install pkgs/yicu_data-*-rhel-4.x.tgz -same -live -down -br test
+ yinst install pkgs/yicu-*-rhel-4.x.tgz -same -live -down -br test
+
+install_php_icu:
+ rm pkgs/*
+ @echo "Getting the packages from Hudson..."
+ if [ ! -z "$(JOB_URL)" ]; then \
+ if [ ! -f /home/y/conf/keydb/appre.keys.keydb ]; then \
+ yinst activate appre_keys; \
+ if [ $$? -eq 0 ]; then \
+ export KEYS_ACTIVATED=1; \
+ fi; \
+ fi; \
+ export "HUDSON_USER=--user-key $(BY_USER_KEY)"; \
+ export "HUDSON_PASSWD=--password-key $(BY_PASSWD_KEY)"; \
+ fi; \
+ scrape-hudson $$HUDSON_USER $$HUDSON_PASSWD -v -o ./pkgs -h=http://hudson.appre.corp.sp1.yahoo.com:9999/yhudson --job I18nLibs-YICU_PHP-RHEL-Trunk-Commit
+ yinst install pkgs/yphp_intl-*-rhel-4.x.tgz -same -live -down -br test
+
+install_phpunit:
+# @yinst install phpunit
+ @yinst install yphp_devel_overrides -br test
+
+upload_results:
+ (yinst install truploader -br test -same -live)
+ -(cd tests && truploader --format junit --file ./results*.xml --userkey g11qa.name --passwordkey g11qa.pwd --property Globalization --product YGlobal --project I18nLibs --testplan yphp_intl --testplantype ALL --function functional --subfunction General)
+
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/msgfmt_format_intlcalendar_51.phpt tests/msgfmt_format_intlcalendar_51.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/msgfmt_format_intlcalendar_51.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/msgfmt_format_intlcalendar_51.phpt 2013-06-21 12:34:26.587754397 +0000
@@ -0,0 +1,31 @@
+--TEST--
+MessageFormat accepts IntlCalendar args icu >= 51
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled');?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') <= 0) print 'skip for ICU < 51'; ?>
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+ini_set('date.timezone', 'Europe/Lisbon');
+
+$cal = new IntlGregorianCalendar(2012,04,17,17,35,36);
+
+$msgf = new MessageFormatter('pt_PT', '{0,date,full} {0,time,h:m:s a V}');
+echo $msgf->format(array($cal)), "\n";
+
+//NOT FIXED:
+/*$msgf = new MessageFormatter('en_US',
+'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
+
+echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
+ $msgf->format(array($time, 'time')), "\n";
+*/
+
+?>
+==DONE==
+--EXPECTF--
+Quinta-feira, 17 de Maio de 2012 5:35:36 PM ptlis
+==DONE==
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/msgfmt_format_intlcalendar.phpt tests/msgfmt_format_intlcalendar.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/msgfmt_format_intlcalendar.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/msgfmt_format_intlcalendar.phpt 2013-06-21 12:33:33.185846866 +0000
@@ -1,9 +1,10 @@
--TEST--
-MessageFormat accepts IntlCalendar args
+MessageFormat accepts IntlCalendar args icu < 51
--SKIPIF--
<?php
if (!extension_loaded('intl'))
- die('skip intl extension not enabled');
+ die('skip intl extension not enabled');?>
+<?php if(version_compare(INTL_ICU_VERSION, '51') > 0) print 'skip for ICU >= 51'; ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
@@ -27,4 +28,4 @@
==DONE==
--EXPECTF--
Quinta-feira, 17 de Maio de 2012 5:35:36 %s WEST
-==DONE==
\ No newline at end of file
+==DONE==
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/parse_community.pl tests/parse_community.pl
--- ../../vendor/php_intl_pecl-3.0.0/tests/parse_community.pl 1970-01-01 00:00:00.000000000 +0000
+++ tests/parse_community.pl 2013-06-06 03:50:23.000000000 +0000
@@ -0,0 +1,63 @@
+#!/usr/local/bin/perl
+
+package ParseCommunity;
+
+use strict;
+
+use base qw(HTML::Parser);
+
+my $inTest=-1;
+my $testCount=0;
+my @testResult=();
+my @testName=();
+my @testSkipReason=();
+
+sub text {
+ my @array = @_;
+
+ if (! defined $inTest) {return;}
+
+ if ($inTest == 0) {
+ $testResult[$testCount] = $array[1];
+ } elsif ($inTest == 1) {
+ $testName[$testCount] = $array[1];
+ } elsif ($inTest == 2 && $testResult[$testCount] eq 'SKIP') {
+ $testSkipReason[$testCount] = $array[1];
+ } elsif ($inTest == 4) {
+ $inTest = -1;
+ $testCount++;
+ }
+
+}
+
+sub start {
+ my ($self, $tagname, $attr, $attrseq, $origtext) = @_;
+ if ($tagname eq 'td') {
+ $inTest++;
+ }
+}
+
+my $parser = ParseCommunity->new;
+
+$parser->handler(text => "text");
+
+$parser->parse_file($ARGV[0]);
+
+for (my $i = 0; $i < $testCount; $i++) {
+ if ($testResult[$i] eq 'FAIL') {
+ print "not ok ";
+ }
+ if ($testResult[$i] eq 'PASS' || $testResult[$i] eq 'SKIP') {
+ print "ok ";
+ }
+
+ if ($testResult[$i] eq 'SKIP') {
+ print $i + 1 . " # SKIP $testName[$1] Reason: $testSkipReason[$i]";
+ } else {
+ print $i + 1 . " " . $testName[$i];
+ }
+
+ print "\n";
+
+}
+print "1..$testCount\n";
Common subdirectories: ../../vendor/php_intl_pecl-3.0.0/tests/testData and tests/testData
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/timezone_getDisplayName_variant2-49+.phpt tests/timezone_getDisplayName_variant2-49+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/timezone_getDisplayName_variant2-49+.phpt 2013-06-02 17:07:04.000000000 +0000
+++ tests/timezone_getDisplayName_variant2-49+.phpt 2013-06-21 12:36:48.474927061 +0000
@@ -1,11 +1,13 @@
--TEST--
-IntlTimeZone::getDisplayName(): type parameter (ICU >= 49)
+IntlTimeZone::getDisplayName(): type parameter (ICU >= 49 && ICU <= 50)
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (version_compare(INTL_ICU_VERSION, '49') < 0)
- die('skip for ICU 49+');
+ die('skip for ICU == 49+');
+if (version_compare(INTL_ICU_VERSION, '51') > 0)
+ die('skip for ICU == 49+');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
diff -uN ../../vendor/php_intl_pecl-3.0.0/tests/timezone_getDisplayName_variant2-51+.phpt tests/timezone_getDisplayName_variant2-51+.phpt
--- ../../vendor/php_intl_pecl-3.0.0/tests/timezone_getDisplayName_variant2-51+.phpt 1970-01-01 00:00:00.000000000 +0000
+++ tests/timezone_getDisplayName_variant2-51+.phpt 2013-06-21 12:39:51.936299576 +0000
@@ -0,0 +1,38 @@
+--TEST--
+IntlTimeZone::getDisplayName(): type parameter (ICU >= 51)
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '51') < 0)
+ die('skip for ICU 51+');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("error_reporting", -1);
+ini_set("display_errors", 1);
+
+$lsb = IntlTimeZone::createTimeZone('Europe/Lisbon');
+
+ini_set('intl.default_locale', 'en_US');
+var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT));
+var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG));
+var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_GENERIC));
+var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG_GENERIC));
+var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_GMT));
+var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG_GMT));
+var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_COMMONLY_USED));
+var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_GENERIC_LOCATION));
+
+?>
+==DONE==
+--EXPECTREGEX--
+string\(3\) "GMT"
+string\(30\) "Western European Standard Time"
+string\(13\) "Portugal Time"
+string\(21\) "Western European Time"
+string\(5\) "\+0000"
+string\(3\) "GMT"
+string\(3\) "GMT"
+string\(13\) "Portugal Time"
+==DONE==
|