summaryrefslogtreecommitdiff
path: root/ext/intl/tests
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-01-11 15:43:42 +0100
committerOndřej Surý <ondrej@sury.org>2012-01-11 15:43:42 +0100
commit8f1428d29ef91d74b4d272af171675f2971eb15b (patch)
treea1f4f4d7dc5bfe8096806dd5c5266634e19fa07a /ext/intl/tests
parentc6e4182351e0173fe58de141e143aac2eacf5efe (diff)
downloadphp-8f1428d29ef91d74b4d272af171675f2971eb15b.tar.gz
Imported Upstream version 5.3.9upstream/5.3.9
Diffstat (limited to 'ext/intl/tests')
-rw-r--r--ext/intl/tests/bug60192-compare.phpt19
-rw-r--r--ext/intl/tests/bug60192-getlocale.phpt20
-rw-r--r--ext/intl/tests/bug60192-getsortkey.phpt20
-rw-r--r--ext/intl/tests/bug60192-sort.phpt21
-rw-r--r--ext/intl/tests/bug60192-sortwithsortkeys.phpt21
-rwxr-xr-xext/intl/tests/dateformat_parse.phpt99
-rwxr-xr-xext/intl/tests/dateformat_parse_timestamp_parsepos.phpt119
-rwxr-xr-xext/intl/tests/locale_get_display_region.phpt12
-rwxr-xr-xext/intl/tests/locale_get_region.phpt12
-rwxr-xr-xext/intl/tests/locale_parse_locale.phpt143
-rw-r--r--ext/intl/tests/resourcebundle_arrayaccess.phpt2
-rw-r--r--ext/intl/tests/resourcebundle_individual.phpt2
-rw-r--r--ext/intl/tests/resourcebundle_iterator.phpt2
13 files changed, 328 insertions, 164 deletions
diff --git a/ext/intl/tests/bug60192-compare.phpt b/ext/intl/tests/bug60192-compare.phpt
new file mode 100644
index 000000000..0fd24cce8
--- /dev/null
+++ b/ext/intl/tests/bug60192-compare.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #60192 (SegFault when Collator not constructed properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded('intl')) { die('skip intl extension not available'); }
+?>
+--FILE--
+<?php
+class Collator2 extends Collator{
+ public function __construct() {
+ // ommitting parent::__construct($someLocale);
+ }
+}
+
+$c = new Collator2();
+$a = $c->compare('h', 'H');
+--EXPECTF--
+
+Catchable fatal error: Collator::compare(): Object not initialized in %s on line %d
diff --git a/ext/intl/tests/bug60192-getlocale.phpt b/ext/intl/tests/bug60192-getlocale.phpt
new file mode 100644
index 000000000..50e3ec35e
--- /dev/null
+++ b/ext/intl/tests/bug60192-getlocale.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60192 (SegFault when Collator not constructed properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded('intl')) { die('skip intl extension not available'); }
+?>
+--FILE--
+<?php
+
+class Collator2 extends Collator{
+ public function __construct() {
+ // ommitting parent::__construct($someLocale);
+ }
+}
+
+$c = new Collator2();
+$c->getLocale(Locale::ACTUAL_LOCALE);
+--EXPECTF--
+
+Catchable fatal error: Collator::getLocale(): Object not initialized in %s on line %d
diff --git a/ext/intl/tests/bug60192-getsortkey.phpt b/ext/intl/tests/bug60192-getsortkey.phpt
new file mode 100644
index 000000000..39755ae8f
--- /dev/null
+++ b/ext/intl/tests/bug60192-getsortkey.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60192 (SegFault when Collator not constructed properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded('intl')) { die('skip intl extension not available'); }
+?>
+--FILE--
+<?php
+
+class Collator2 extends Collator{
+ public function __construct() {
+ // ommitting parent::__construct($someLocale);
+ }
+}
+
+$c = new Collator2();
+$c->getSortKey('h');
+--EXPECTF--
+
+Catchable fatal error: Collator::getSortKey(): Object not initialized in %s on line %d
diff --git a/ext/intl/tests/bug60192-sort.phpt b/ext/intl/tests/bug60192-sort.phpt
new file mode 100644
index 000000000..57057215e
--- /dev/null
+++ b/ext/intl/tests/bug60192-sort.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #60192 (SegFault when Collator not constructed properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded('intl')) { die('skip intl extension not available'); }
+?>
+--FILE--
+<?php
+
+class Collator2 extends Collator{
+ public function __construct() {
+ // ommitting parent::__construct($someLocale);
+ }
+}
+
+$c = new Collator2();
+$a = array('a', 'b');
+$c->sort($a);
+--EXPECTF--
+
+Catchable fatal error: Collator::sort(): Object not initialized in %s on line %d
diff --git a/ext/intl/tests/bug60192-sortwithsortkeys.phpt b/ext/intl/tests/bug60192-sortwithsortkeys.phpt
new file mode 100644
index 000000000..445f4a03b
--- /dev/null
+++ b/ext/intl/tests/bug60192-sortwithsortkeys.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #60192 (SegFault when Collator not constructed properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded('intl')) { die('skip intl extension not available'); }
+?>
+--FILE--
+<?php
+
+class Collator2 extends Collator{
+ public function __construct() {
+ // ommitting parent::__construct($someLocale);
+ }
+}
+
+$c = new Collator2();
+$a = array('a', 'b');
+$c->sortWithSortKeys($a);
+--EXPECTF--
+
+Catchable fatal error: Collator::sortWithSortKeys(): Object not initialized in %s on line %d
diff --git a/ext/intl/tests/dateformat_parse.phpt b/ext/intl/tests/dateformat_parse.phpt
index b3be895e5..ce800aa48 100755
--- a/ext/intl/tests/dateformat_parse.phpt
+++ b/ext/intl/tests/dateformat_parse.phpt
@@ -2,6 +2,8 @@
datefmt_parse_code()
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--INI--
+date.timezone="America/Los_Angeles"
--FILE--
<?php
@@ -9,13 +11,14 @@ datefmt_parse_code()
* Test for the datefmt_parse function
*/
+putenv('TZ=America/Los_Angeles');
function ut_main()
{
$locale_arr = array (
'en_US_CA'
);
-
+
$datetype_arr = array (
IntlDateFormatter::FULL,
IntlDateFormatter::LONG,
@@ -28,36 +31,34 @@ function ut_main()
$text_arr = array (
- "Sunday, September 18, 2039 4:06:40 PM PT",
- "Wednesday, December 17, 1969 6:40:00 PM PT",
- "Thursday, December 18, 1969 8:49:59 AM PST",
- "Thursday, December 18, 1969 8:49:59 PM PST",
- "December 18, 1969 8:49:59 AM PST",
- "12/18/69 8:49 AM",
- "19691218 08:49 AM"
+ // Full parsing
+ array("Sunday, September 18, 2039 4:06:40 PM PT", IntlDateFormatter::FULL, IntlDateFormatter::FULL),
+ array("Wednesday, December 17, 1969 6:40:00 PM PT", IntlDateFormatter::FULL, IntlDateFormatter::FULL),
+ array("Thursday, December 18, 1969 8:49:59 PM PST", IntlDateFormatter::FULL, IntlDateFormatter::FULL),
+ array("December 18, 1969 8:49:59 AM PST", IntlDateFormatter::LONG, IntlDateFormatter::FULL),
+ array("12/18/69 8:49 AM", IntlDateFormatter::SHORT, IntlDateFormatter::SHORT),
+ array("19691218 08:49 AM", IntlDateFormatter::SHORT, IntlDateFormatter::SHORT),
+ // Partial parsing
+ array("Sunday, September 18, 2039 4:06:40 PM PT", IntlDateFormatter::FULL, IntlDateFormatter::NONE),
+ array("Sunday, September 18, 2039 4:06:40 PM PT", IntlDateFormatter::FULL, IntlDateFormatter::SHORT),
+ array("December 18, 1969 8:49:59 AM PST", IntlDateFormatter::LONG, IntlDateFormatter::NONE),
+ array("December 18, 1969 8:49:59 AM PST", IntlDateFormatter::LONG, IntlDateFormatter::SHORT),
+ array("12/18/69 8:49 AM", IntlDateFormatter::SHORT, IntlDateFormatter::LONG),
+ array("19691218 08:49 AM", IntlDateFormatter::SHORT, IntlDateFormatter::LONG),
);
- $parse_pos = 0;
- $fmt = ut_datefmt_create( 'en_US_CA', IntlDateFormatter::NONE, IntlDateFormatter::SHORT);
foreach( $text_arr as $text_entry){
- for ( $parse_pos = 0 ; $parse_pos< strlen($text_entry) ; $parse_pos++ ){
- $i = $parse_pos;
- $parsed = ut_datefmt_parse( $fmt , $text_entry , $parse_pos );
- if( intl_get_error_code() == U_ZERO_ERROR){
- $res_str .= "\nInput text :$text_entry ; Parsed text : $parsed";
- $res_str .= " ; parse_pos : $i $parse_pos";
- } else {
- $parse_pos = $i;
- }
-/*
- else{
- $res_str .= "\nError while parsing as: '".intl_get_error_message()."'";
- }
-*/
+ $fmt = ut_datefmt_create( 'en_US_CA', $text_entry[1], $text_entry[2]);
+ $parse_pos = 0;
+ $parsed = ut_datefmt_parse( $fmt , $text_entry[0] , $parse_pos );
+
+ $res_str .= "\nInput text : {$text_entry[0]} ; DF = {$text_entry[1]}; TF = {$text_entry[2]}";
+ if( intl_get_error_code() != U_ZERO_ERROR) {
+ $res_str .= "\nError : ".intl_get_error_message();
}
+ $res_str .= "\nParsed: $parsed; parse_pos : $parse_pos\n";
}
-
return $res_str;
}
@@ -68,10 +69,44 @@ include_once( 'ut_common.inc' );
ut_run();
?>
--EXPECT--
-Input text :Sunday, September 18, 2039 4:06:40 PM PT ; Parsed text : 96000 ; parse_pos : 29 37
-Input text :Wednesday, December 17, 1969 6:40:00 PM PT ; Parsed text : 216000 ; parse_pos : 31 39
-Input text :Thursday, December 18, 1969 8:49:59 AM PST ; Parsed text : 208740 ; parse_pos : 30 38
-Input text :Thursday, December 18, 1969 8:49:59 PM PST ; Parsed text : 251940 ; parse_pos : 30 38
-Input text :December 18, 1969 8:49:59 AM PST ; Parsed text : 208740 ; parse_pos : 20 28
-Input text :12/18/69 8:49 AM ; Parsed text : 60540 ; parse_pos : 8 16
-Input text :19691218 08:49 AM ; Parsed text : 60540 ; parse_pos : 8 17
+
+Input text : Sunday, September 18, 2039 4:06:40 PM PT ; DF = 0; TF = 0
+Parsed: 2200000000; parse_pos : 40
+
+Input text : Wednesday, December 17, 1969 6:40:00 PM PT ; DF = 0; TF = 0
+Parsed: -1200000; parse_pos : 42
+
+Input text : Thursday, December 18, 1969 8:49:59 PM PST ; DF = 0; TF = 0
+Parsed: -1105801; parse_pos : 42
+
+Input text : December 18, 1969 8:49:59 AM PST ; DF = 1; TF = 0
+Parsed: -1149001; parse_pos : 32
+
+Input text : 12/18/69 8:49 AM ; DF = 3; TF = 3
+Parsed: -1149060; parse_pos : 16
+
+Input text : 19691218 08:49 AM ; DF = 3; TF = 3
+Error : Date parsing failed: U_PARSE_ERROR
+Parsed: ; parse_pos : 8
+
+Input text : Sunday, September 18, 2039 4:06:40 PM PT ; DF = 0; TF = -1
+Parsed: 2199942000; parse_pos : 26
+
+Input text : Sunday, September 18, 2039 4:06:40 PM PT ; DF = 0; TF = 3
+Error : Date parsing failed: U_PARSE_ERROR
+Parsed: ; parse_pos : 31
+
+Input text : December 18, 1969 8:49:59 AM PST ; DF = 1; TF = -1
+Parsed: -1180800; parse_pos : 17
+
+Input text : December 18, 1969 8:49:59 AM PST ; DF = 1; TF = 3
+Error : Date parsing failed: U_PARSE_ERROR
+Parsed: ; parse_pos : 22
+
+Input text : 12/18/69 8:49 AM ; DF = 3; TF = 1
+Error : Date parsing failed: U_PARSE_ERROR
+Parsed: ; parse_pos : 13
+
+Input text : 19691218 08:49 AM ; DF = 3; TF = 1
+Error : Date parsing failed: U_PARSE_ERROR
+Parsed: ; parse_pos : 8
diff --git a/ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt b/ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt
index b7e820388..040f72e47 100755
--- a/ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt
+++ b/ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt
@@ -2,6 +2,10 @@
datefmt_parse_timestamp_code() with parse pos
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--INI--
+datetime.timezone="America/Los_Angeles"
+--ENV--
+TZ=America/Los_Angeles
--FILE--
<?php
@@ -15,7 +19,7 @@ function ut_main()
$locale_arr = array (
'en_US_CA'
);
-
+
$datetype_arr = array (
IntlDateFormatter::FULL,
IntlDateFormatter::LONG,
@@ -31,8 +35,8 @@ function ut_main()
"Sunday, September 18, 3039 4:06:40 PM PT",
"Thursday, December 18, 1969 8:49:59 AM PST",
//"December 18, 1969 8:49:59 AM PST",
- //"12/18/69 8:49 AM",
- "19001218 08:49 AM",
+ "12/18/69 8:49 AM",
+ "20111218 08:49 AM",
"19691218 08:49 AM"
);
@@ -46,18 +50,19 @@ function ut_main()
$res_str .= "\n------------";
foreach( $datetype_arr as $datetype_entry )
{
- $res_str .= "\ndatetype = $datetype_entry ,timetype =$datetype_entry ";
+ $res_str .= "\ndatetype = $datetype_entry ,timetype =$datetype_entry";
$fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry);
- $parsed = ut_datefmt_parse( $fmt , $text_entry);
+ $pos = 0;
+ $parsed = ut_datefmt_parse( $fmt , $text_entry, $pos);
if( intl_get_error_code() == U_ZERO_ERROR){
- $res_str .= "\nParsed text is : $parsed";
+ $res_str .= "\nParsed text is : $parsed; Position = $pos";
}else{
- $res_str .= "\nError while parsing as: '".intl_get_error_message()."'";
+ $res_str .= "\nError while parsing as: '".intl_get_error_message()."'; Position = $pos";
}
}
}
}
-
+ $res_str .= "\n";
return $res_str;
@@ -75,61 +80,77 @@ Input text is : Sunday, September 18, 3039 4:06:40 PM PT
------------
Locale is : en_US_CA
------------
-datetype = 0 ,timetype =0
-Parsed text is : 33756908800
-datetype = 1 ,timetype =1
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 2 ,timetype =2
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 3 ,timetype =3
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = -1 ,timetype =-1
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
+datetype = 0 ,timetype =0
+Parsed text is : 33756908800; Position = 40
+datetype = 1 ,timetype =1
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 2 ,timetype =2
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 3 ,timetype =3
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = -1 ,timetype =-1
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
------------
Input text is : Thursday, December 18, 1969 8:49:59 AM PST
------------
Locale is : en_US_CA
------------
-datetype = 0 ,timetype =0
-Parsed text is : -1149001
-datetype = 1 ,timetype =1
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 2 ,timetype =2
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 3 ,timetype =3
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = -1 ,timetype =-1
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
+datetype = 0 ,timetype =0
+Parsed text is : -1149001; Position = 42
+datetype = 1 ,timetype =1
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 2 ,timetype =2
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 3 ,timetype =3
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = -1 ,timetype =-1
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+------------
+
+Input text is : 12/18/69 8:49 AM
+------------
+Locale is : en_US_CA
+------------
+datetype = 0 ,timetype =0
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 1 ,timetype =1
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 2 ,timetype =2
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 3 ,timetype =3
+Parsed text is : -1149060; Position = 16
+datetype = -1 ,timetype =-1
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
------------
-Input text is : 19001218 08:49 AM
+Input text is : 20111218 08:49 AM
------------
Locale is : en_US_CA
------------
-datetype = 0 ,timetype =0
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 1 ,timetype =1
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 2 ,timetype =2
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 3 ,timetype =3
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = -1 ,timetype =-1
-Parsed text is : -2178601860
+datetype = 0 ,timetype =0
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 1 ,timetype =1
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 2 ,timetype =2
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 3 ,timetype =3
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 8
+datetype = -1 ,timetype =-1
+Parsed text is : 1324226940; Position = 17
------------
Input text is : 19691218 08:49 AM
------------
Locale is : en_US_CA
------------
-datetype = 0 ,timetype =0
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 1 ,timetype =1
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 2 ,timetype =2
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = 3 ,timetype =3
-Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'
-datetype = -1 ,timetype =-1
-Parsed text is : -1149060
+datetype = 0 ,timetype =0
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 1 ,timetype =1
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 2 ,timetype =2
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0
+datetype = 3 ,timetype =3
+Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 8
+datetype = -1 ,timetype =-1
+Parsed text is : -1149060; Position = 17
diff --git a/ext/intl/tests/locale_get_display_region.phpt b/ext/intl/tests/locale_get_display_region.phpt
index 354fc0623..48cd7b6c7 100755
--- a/ext/intl/tests/locale_get_display_region.phpt
+++ b/ext/intl/tests/locale_get_display_region.phpt
@@ -163,14 +163,14 @@ disp_locale=fr : display_region=Serbie-et-Monténégro
disp_locale=de : display_region=Serbien und Montenegro
-----------------
locale='sl-rozaj'
-disp_locale=en : display_region=
-disp_locale=fr : display_region=
-disp_locale=de : display_region=
+disp_locale=en : display_region=(ROZAJ)?
+disp_locale=fr : display_region=(ROZAJ)?
+disp_locale=de : display_region=(ROZAJ)?
-----------------
locale='sl-nedis'
-disp_locale=en : display_region=
-disp_locale=fr : display_region=
-disp_locale=de : display_region=
+disp_locale=en : display_region=(NEDIS)?
+disp_locale=fr : display_region=(NEDIS)?
+disp_locale=de : display_region=(NEDIS)?
-----------------
locale='de-CH-1901'
disp_locale=en : display_region=Switzerland
diff --git a/ext/intl/tests/locale_get_region.phpt b/ext/intl/tests/locale_get_region.phpt
index 0bebb331a..0baae4993 100755
--- a/ext/intl/tests/locale_get_region.phpt
+++ b/ext/intl/tests/locale_get_region.phpt
@@ -84,7 +84,7 @@ include_once( 'ut_common.inc' );
ut_run();
?>
---EXPECT--
+--EXPECTF--
uk-ua_CALIFORNIA@currency=;currency=GRN: region='UA'
root: region=''
uk@currency=EURO: region=''
@@ -99,8 +99,8 @@ sr-Cyrl: region=''
sr-Latn: region=''
zh-Hans-CN: region='CN'
sr-Latn-CS: region='CS'
-sl-rozaj: region=''
-sl-nedis: region=''
+sl-rozaj: region='%r(ROZAJ)?%r'
+sl-nedis: region='%r(NEDIS)?%r'
de-CH-1901: region='CH'
sl-IT-nedis: region='IT'
sl-Latn-IT-nedis: region='IT'
@@ -108,7 +108,7 @@ de-DE: region='DE'
en-US: region='US'
es-419: region='419'
de-CH-x-phonebk: region='CH'
-az-Arab-x-AZE-derbend: region=''
+az-Arab-x-AZE-derbend: region='%r(X)?%r'
zh-min: region=''
zh-min-nan-Hant-CN: region='MIN'
x-whatever: region=''
@@ -117,7 +117,7 @@ sr-Latn-QM: region='QM'
sr-Qaaa-CS: region='CS'
en-US-u-islamCal: region='US'
zh-CN-a-myExt-x-private: region='CN'
-en-a-myExt-b-another: region=''
+en-a-myExt-b-another: region='%r(A)?%r'
de-419-DE: region='419'
a-DE: region='DE'
-ar-a-aaa-b-bbb-a-ccc: region=''
+ar-a-aaa-b-bbb-a-ccc: region='%r(A)?%r'
diff --git a/ext/intl/tests/locale_parse_locale.phpt b/ext/intl/tests/locale_parse_locale.phpt
index e47f71830..36637f0d8 100755
--- a/ext/intl/tests/locale_parse_locale.phpt
+++ b/ext/intl/tests/locale_parse_locale.phpt
@@ -6,7 +6,7 @@ locale_parse_locale()
<?php
/*
- * Try parsing different Locales
+ * Try parsing different Locales
* with Procedural and Object methods.
*/
@@ -72,11 +72,12 @@ function ut_main()
{
$arr = ut_loc_locale_parse( $locale);
$res_str .= "---------------------\n";
- $res_str .= "$locale: \n";
+ $res_str .= "$locale:\n";
if( $arr){
foreach( $arr as $key => $value){
$res_str .= "$key : '$value' , ";
}
+ $res_str = rtrim($res_str);
}
else{
$res_str .= "No values found from Locale parsing.";
@@ -93,109 +94,109 @@ include_once( 'ut_common.inc' );
ut_run();
?>
---EXPECT--
+--EXPECTF--
---------------------
-uk-ua_CALIFORNIA@currency=;currency=GRN:
-language : 'uk' , region : 'UA' , variant0 : 'CALIFORNIA' ,
+uk-ua_CALIFORNIA@currency=;currency=GRN:
+language : 'uk' , region : 'UA' , variant0 : 'CALIFORNIA' ,
---------------------
-root:
-language : 'root' ,
+root:
+language : 'root' ,
---------------------
-uk@currency=EURO:
-language : 'uk' ,
+uk@currency=EURO:
+language : 'uk' ,
---------------------
-Hindi:
-language : 'hindi' ,
+Hindi:
+language : 'hindi' ,
---------------------
-de:
-language : 'de' ,
+de:
+language : 'de' ,
---------------------
-fr:
-language : 'fr' ,
+fr:
+language : 'fr' ,
---------------------
-ja:
-language : 'ja' ,
+ja:
+language : 'ja' ,
---------------------
-i-enochian:
-grandfathered : 'i-enochian' ,
+i-enochian:
+grandfathered : 'i-enochian' ,
---------------------
-zh-Hant:
-language : 'zh' , script : 'Hant' ,
+zh-Hant:
+language : 'zh' , script : 'Hant' ,
---------------------
-zh-Hans:
-language : 'zh' , script : 'Hans' ,
+zh-Hans:
+language : 'zh' , script : 'Hans' ,
---------------------
-sr-Cyrl:
-language : 'sr' , script : 'Cyrl' ,
+sr-Cyrl:
+language : 'sr' , script : 'Cyrl' ,
---------------------
-sr-Latn:
-language : 'sr' , script : 'Latn' ,
+sr-Latn:
+language : 'sr' , script : 'Latn' ,
---------------------
-zh-Hans-CN:
-language : 'zh' , script : 'Hans' , region : 'CN' ,
+zh-Hans-CN:
+language : 'zh' , script : 'Hans' , region : 'CN' ,
---------------------
-sr-Latn-CS:
-language : 'sr' , script : 'Latn' , region : 'CS' ,
+sr-Latn-CS:
+language : 'sr' , script : 'Latn' , region : 'CS' ,
---------------------
-sl-rozaj:
-language : 'sl' ,
+sl-rozaj:
+language : 'sl' ,%r( region : 'ROZAJ' ,)?%r
---------------------
-sl-nedis:
-language : 'sl' ,
+sl-nedis:
+language : 'sl' ,%r( region : 'NEDIS' ,)?%r
---------------------
-de-CH-1901:
-language : 'de' , region : 'CH' , variant0 : '1901' ,
+de-CH-1901:
+language : 'de' , region : 'CH' , variant0 : '1901' ,
---------------------
-sl-IT-nedis:
-language : 'sl' , region : 'IT' , variant0 : 'NEDIS' ,
+sl-IT-nedis:
+language : 'sl' , region : 'IT' , variant0 : 'NEDIS' ,
---------------------
-sl-Latn-IT-nedis:
-language : 'sl' , script : 'Latn' , region : 'IT' , variant0 : 'NEDIS' ,
+sl-Latn-IT-nedis:
+language : 'sl' , script : 'Latn' , region : 'IT' , variant0 : 'NEDIS' ,
---------------------
-de-DE:
-language : 'de' , region : 'DE' ,
+de-DE:
+language : 'de' , region : 'DE' ,
---------------------
-en-US:
-language : 'en' , region : 'US' ,
+en-US:
+language : 'en' , region : 'US' ,
---------------------
-es-419:
-language : 'es' , region : '419' ,
+es-419:
+language : 'es' , region : '419' ,
---------------------
-de-CH-x-phonebk:
-language : 'de' , region : 'CH' , private0 : 'phonebk' ,
+de-CH-x-phonebk:
+language : 'de' , region : 'CH' , private0 : 'phonebk' ,
---------------------
-az-Arab-x-AZE-derbend:
-language : 'az' , script : 'Arab' , private0 : 'AZE' , private1 : 'derbend' ,
+az-Arab-x-AZE-derbend:
+language : 'az' , script : 'Arab' , private0 : 'AZE' , private1 : 'derbend' ,
---------------------
-zh-min:
-grandfathered : 'zh-min' ,
+zh-min:
+grandfathered : 'zh-min' ,
---------------------
-zh-min-nan-Hant-CN:
-language : 'zh' , region : 'MIN' , variant0 : 'NAN' , variant1 : 'HANT' , variant2 : 'CN' ,
+zh-min-nan-Hant-CN:
+language : 'zh' , region : 'MIN' , variant0 : 'NAN' , variant1 : 'HANT' , variant2 : 'CN' ,
---------------------
-qaa-Qaaa-QM-x-southern:
-language : 'qaa' , script : 'Qaaa' , region : 'QM' , private0 : 'southern' ,
+qaa-Qaaa-QM-x-southern:
+language : 'qaa' , script : 'Qaaa' , region : 'QM' , private0 : 'southern' ,
---------------------
-sr-Latn-QM:
-language : 'sr' , script : 'Latn' , region : 'QM' ,
+sr-Latn-QM:
+language : 'sr' , script : 'Latn' , region : 'QM' ,
---------------------
-sr-Qaaa-CS:
-language : 'sr' , script : 'Qaaa' , region : 'CS' ,
+sr-Qaaa-CS:
+language : 'sr' , script : 'Qaaa' , region : 'CS' ,
---------------------
-en-US-u-islamCal:
-language : 'en' , region : 'US' ,
+en-US-u-islamCal:
+language : 'en' , region : 'US' ,
---------------------
-zh-CN-a-myExt-x-private:
-language : 'zh' , region : 'CN' , private0 : 'private' ,
+zh-CN-a-myExt-x-private:
+language : 'zh' , region : 'CN' , private0 : 'private' ,
---------------------
-en-a-myExt-b-another:
-language : 'en' ,
+en-a-myExt-b-another:
+language : 'en' ,
---------------------
-de-419-DE:
-language : 'de' , region : '419' , variant0 : 'DE' ,
+de-419-DE:
+language : 'de' , region : '419' , variant0 : 'DE' ,
---------------------
-a-DE:
+a-DE:
No values found from Locale parsing.
---------------------
-ar-a-aaa-b-bbb-a-ccc:
+ar-a-aaa-b-bbb-a-ccc:
language : 'ar' ,
diff --git a/ext/intl/tests/resourcebundle_arrayaccess.phpt b/ext/intl/tests/resourcebundle_arrayaccess.phpt
index ef2c0a8b9..d035a8d30 100644
--- a/ext/intl/tests/resourcebundle_arrayaccess.phpt
+++ b/ext/intl/tests/resourcebundle_arrayaccess.phpt
@@ -1,5 +1,7 @@
--TEST--
Test ResourceBundle array access and count - existing/missing keys
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
include "resourcebundle.inc";
diff --git a/ext/intl/tests/resourcebundle_individual.phpt b/ext/intl/tests/resourcebundle_individual.phpt
index 182cbf325..dcbf1f583 100644
--- a/ext/intl/tests/resourcebundle_individual.phpt
+++ b/ext/intl/tests/resourcebundle_individual.phpt
@@ -1,5 +1,7 @@
--TEST--
Test ResourceBundle::get() and length() - existing/missing keys
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
include "resourcebundle.inc";
diff --git a/ext/intl/tests/resourcebundle_iterator.phpt b/ext/intl/tests/resourcebundle_iterator.phpt
index 31b0768bf..a10b9deb8 100644
--- a/ext/intl/tests/resourcebundle_iterator.phpt
+++ b/ext/intl/tests/resourcebundle_iterator.phpt
@@ -1,5 +1,7 @@
--TEST--
Test ResourceBundle iterator
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
include "resourcebundle.inc";