Skip to content

Commit

Permalink
Update tests for ICU 64
Browse files Browse the repository at this point in the history
(cherry picked from commit 8a8bc5c)
  • Loading branch information
nikic authored and weltling committed Jun 1, 2019
1 parent d293f6d commit b01d9fd
Show file tree
Hide file tree
Showing 8 changed files with 371 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ext/intl/locale/locale_methods.c
Expand Up @@ -1554,7 +1554,7 @@ PHP_FUNCTION(locale_lookup)

intl_error_reset( NULL );

if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS", &arr, &loc_range, &loc_range_len,
if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS!", &arr, &loc_range, &loc_range_len,
&boolCanonical, &fallback_loc_str) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 );
RETURN_FALSE;
Expand Down
1 change: 1 addition & 0 deletions ext/intl/tests/breakiter_getLocale_basic2.phpt
Expand Up @@ -3,6 +3,7 @@ IntlBreakIterator::getLocale(): basic test
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
Expand Down
20 changes: 20 additions & 0 deletions ext/intl/tests/breakiter_getLocale_basic3.phpt
@@ -0,0 +1,20 @@
--TEST--
IntlBreakIterator::getLocale(): basic test
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");

$bi = IntlBreakIterator::createSentenceInstance('pt');

var_dump($bi->getLocale(0));
var_dump($bi->getLocale(1));
?>
==DONE==
--EXPECT--
string(0) ""
string(2) "pt"
==DONE==
6 changes: 3 additions & 3 deletions ext/intl/tests/locale_get_display_language.phpt
Expand Up @@ -99,9 +99,9 @@ disp_locale=fr : display_language=ukrainien
disp_locale=de : display_language=Ukrainisch
-----------------
locale='root'
disp_locale=en : display_language=Root
disp_locale=fr : display_language=racine
disp_locale=de : display_language=[rR]oot
disp_locale=en : display_language=(Root|Unknown language)
disp_locale=fr : display_language=(racine|langue indéterminée)
disp_locale=de : display_language=([rR]oot|Unbekannte Sprache)
-----------------
locale='uk@currency=EURO'
disp_locale=en : display_language=Ukrainian
Expand Down
1 change: 1 addition & 0 deletions ext/intl/tests/locale_get_display_name5.phpt
Expand Up @@ -3,6 +3,7 @@ locale_get_display_name() icu >= 53.1
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?>
--FILE--
<?php

Expand Down

0 comments on commit b01d9fd

Please sign in to comment.