ext/intl: modernize tests (#19392)

This is effectively removing ZPP tests, enabling warnings, and moving INI settings into the INI PHPT block
This commit is contained in:
Gina Peter Banyard 2025-08-06 23:33:48 +01:00 committed by GitHub
parent 3fc0149325
commit c42e6d62d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
222 changed files with 427 additions and 1624 deletions

View file

@ -4,12 +4,12 @@ IntlBreakIterator::__construct() should not be callable
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
try {
new IntlBreakIterator(); new IntlBreakIterator();
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?> ?>
--EXPECTF-- --EXPECT--
Fatal error: Uncaught Error: Call to private IntlBreakIterator::__construct() from global scope in %s:%d Error: Call to private IntlBreakIterator::__construct() from global scope
Stack trace:
#0 {main}
thrown in %s on line %d

View file

@ -5,53 +5,44 @@ intl
--FILE-- --FILE--
<?php <?php
function print_exception($e) {
echo "\nException: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n";
}
//missing ; at the end: //missing ; at the end:
try { try {
var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+')); var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+'));
} catch (IntlException $e) { } catch (Throwable $e) {
print_exception($e); echo $e::class, ': ', $e->getMessage(), PHP_EOL;
} }
try { try {
var_dump(new IntlRuleBasedBreakIterator()); var_dump(new IntlRuleBasedBreakIterator());
} catch (TypeError $e) { } catch (Throwable $e) {
print_exception($e); echo $e::class, ': ', $e->getMessage(), PHP_EOL;
} }
try { try {
var_dump(new IntlRuleBasedBreakIterator(1,2,3)); var_dump(new IntlRuleBasedBreakIterator(1,2,3));
} catch (TypeError $e) { } catch (Throwable $e) {
print_exception($e); echo $e::class, ': ', $e->getMessage(), PHP_EOL;
} }
try { try {
var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', array())); var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', array()));
} catch (TypeError $e) { } catch (Throwable $e) {
print_exception($e); echo $e::class, ': ', $e->getMessage(), PHP_EOL;
} }
try { try {
var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', true)); var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', true));
} catch (IntlException $e) { } catch (Throwable $e) {
print_exception($e); echo $e::class, ': ', $e->getMessage(), PHP_EOL;
} }
$rbbi = new IntlRuleBasedBreakIterator(".;"); $rbbi = new IntlRuleBasedBreakIterator(".;");
try { try {
$rbbi->__construct(".;"); $rbbi->__construct(".;");
} catch (Error $e) { } catch (Throwable $e) {
print_exception($e); echo $e::class, ': ', $e->getMessage(), PHP_EOL;
} }
?> ?>
--EXPECTF-- --EXPECT--
Exception: IntlRuleBasedBreakIterator::__construct(): unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d IntlException: IntlRuleBasedBreakIterator::__construct(): unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31)
ArgumentCountError: IntlRuleBasedBreakIterator::__construct() expects at least 1 argument, 0 given
Exception: IntlRuleBasedBreakIterator::__construct() expects at least 1 argument, 0 given in %s on line %d ArgumentCountError: IntlRuleBasedBreakIterator::__construct() expects at most 2 arguments, 3 given
TypeError: IntlRuleBasedBreakIterator::__construct(): Argument #2 ($compiled) must be of type bool, array given
Exception: IntlRuleBasedBreakIterator::__construct() expects at most 2 arguments, 3 given in %s on line %d IntlException: IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules
Error: IntlRuleBasedBreakIterator object is already constructed
Exception: IntlRuleBasedBreakIterator::__construct(): Argument #2 ($compiled) must be of type bool, array given in %s on line %d
Exception: IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules in %s on line %d
Exception: IntlRuleBasedBreakIterator object is already constructed in %s on line %d

View file

@ -4,7 +4,6 @@ IntlBreakIterator: clone handler
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
$bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;'); $bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;');
$bi_clone = clone $bi; $bi_clone = clone $bi;

View file

@ -2,10 +2,10 @@
IntlBreakIterator::createCodePointInstance(): basic test IntlBreakIterator::createCodePointInstance(): basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=pt_PT
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$text = 'ตัวอย่างข้อความ'; $text = 'ตัวอย่างข้อความ';

View file

@ -4,8 +4,6 @@ IntlBreakIterator::current(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
var_dump($bi->current()); var_dump($bi->current());

View file

@ -2,10 +2,10 @@
IntlBreakIterator factories: basic tests IntlBreakIterator factories: basic tests
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=ja
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "ja");
$m = array('createWordInstance', 'createLineInstance', 'createCharacterInstance', $m = array('createWordInstance', 'createLineInstance', 'createCharacterInstance',
'createSentenceInstance', 'createTitleInstance'); 'createSentenceInstance', 'createTitleInstance');

View file

@ -4,7 +4,6 @@ IntlBreakIterator::first(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans'); $bi->setText('foo bar trans');

View file

@ -4,8 +4,6 @@ IntlBreakIterator::following(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans zoo bee'); $bi->setText('foo bar trans zoo bee');

View file

@ -6,8 +6,6 @@ intl
<?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?> <?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?>
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createSentenceInstance('pt'); $bi = IntlBreakIterator::createSentenceInstance('pt');

View file

@ -6,8 +6,6 @@ intl
<?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?> <?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?>
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createSentenceInstance('pt'); $bi = IntlBreakIterator::createSentenceInstance('pt');

View file

@ -8,8 +8,6 @@ if (version_compare(INTL_ICU_VERSION, '57.1') > 0) die('skip for ICU <= 57.1');
?> ?>
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$pi = $bi->getPartsIterator(); $pi = $bi->getPartsIterator();

View file

@ -8,8 +8,6 @@ if (version_compare(INTL_ICU_VERSION, '57.1') <= 0) die('skip for ICU > 57.1');
?> ?>
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$pi = $bi->getPartsIterator(); $pi = $bi->getPartsIterator();

View file

@ -4,7 +4,6 @@ IntlBreakIterator::getPartsIterator(): bad args
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.default_locale", "pt_PT");
$it = IntlBreakIterator::createWordInstance(NULL); $it = IntlBreakIterator::createWordInstance(NULL);

View file

@ -2,10 +2,10 @@
IntlBreakIterator::getPartsIterator(): argument variations IntlBreakIterator::getPartsIterator(): argument variations
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=pt_PT
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$text = 'foo bar tao'; $text = 'foo bar tao';

View file

@ -4,7 +4,6 @@ IntlBreakIterator::getText(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
var_dump($bi->getText()); var_dump($bi->getText());

View file

@ -4,8 +4,6 @@ IntlBreakIterator::isBoundary(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans zoo bee'); $bi->setText('foo bar trans zoo bee');

View file

@ -4,7 +4,6 @@ IntlBreakIterator::last(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans'); $bi->setText('foo bar trans');

View file

@ -4,8 +4,6 @@ IntlBreakIterator::next(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans zoo bee'); $bi->setText('foo bar trans zoo bee');

View file

@ -8,8 +8,6 @@ if (version_compare(INTL_ICU_VERSION, '57.1') > 0) die('skip for ICU <= 57.1');
?> ?>
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans zoo bee'); $bi->setText('foo bar trans zoo bee');

View file

@ -8,8 +8,6 @@ if (version_compare(INTL_ICU_VERSION, '57.1') <= 0) die('skip for ICU > 57.1');
?> ?>
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans zoo bee'); $bi->setText('foo bar trans zoo bee');

View file

@ -4,8 +4,6 @@ IntlBreakIterator::previous(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt'); $bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans'); $bi->setText('foo bar trans');

View file

@ -4,7 +4,6 @@ IntlBreakIterator::setText(): basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
class A { class A {
function __tostring() { return 'aaa'; } function __tostring() { return 'aaa'; }

View file

@ -2,6 +2,8 @@
Bug #58756: w.r.t MessageFormatter Bug #58756: w.r.t MessageFormatter
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
date.timezone=America/New_York
--SKIPIF-- --SKIPIF--
<?php <?php
if (str_contains(PHP_OS, 'FreeBSD')) { if (str_contains(PHP_OS, 'FreeBSD')) {
@ -10,13 +12,9 @@ if (str_contains(PHP_OS, 'FreeBSD')) {
?> ?>
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
//ini_set("intl.default_locale", "nl");
$time = 1247013673; $time = 1247013673;
ini_set('date.timezone', 'America/New_York');
$msgf = new MessageFormatter('en_US', '{0,date,full} {0,time,h:m:s a V}'); $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 "date: " . date('l, F j, Y g:i:s A T', $time) . "\n";

View file

@ -11,11 +11,11 @@ class Collator2 extends Collator{
} }
$c = new Collator2(); $c = new Collator2();
try {
$a = $c->compare('h', 'H'); $a = $c->compare('h', 'H');
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?> ?>
--EXPECTF-- --EXPECT--
Fatal error: Uncaught Error: Object not initialized in %s:%d Error: Object not initialized
Stack trace:
#0 %s(%d): Collator->compare('h', 'H')
#1 {main}
thrown in %s on line %d

View file

@ -12,11 +12,11 @@ class Collator2 extends Collator{
} }
$c = new Collator2(); $c = new Collator2();
try {
$c->getLocale(Locale::ACTUAL_LOCALE); $c->getLocale(Locale::ACTUAL_LOCALE);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?> ?>
--EXPECTF-- --EXPECT--
Fatal error: Uncaught Error: Object not initialized in %s:%d Error: Object not initialized
Stack trace:
#0 %s(%d): Collator->getLocale(0)
#1 {main}
thrown in %s on line %d

View file

@ -12,11 +12,11 @@ class Collator2 extends Collator{
} }
$c = new Collator2(); $c = new Collator2();
try {
$c->getSortKey('h'); $c->getSortKey('h');
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?> ?>
--EXPECTF-- --EXPECT--
Fatal error: Uncaught Error: Object not initialized in %s:%d Error: Object not initialized
Stack trace:
#0 %s(%d): Collator->getSortKey('h')
#1 {main}
thrown in %s on line %d

View file

@ -13,11 +13,11 @@ class Collator2 extends Collator{
$c = new Collator2(); $c = new Collator2();
$a = array('a', 'b'); $a = array('a', 'b');
try {
$c->sort($a); $c->sort($a);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?> ?>
--EXPECTF-- --EXPECT--
Fatal error: Uncaught Error: Object not initialized in %s:%d Error: Object not initialized
Stack trace:
#0 %s(%d): Collator->sort(Array)
#1 {main}
thrown in %s on line %d

View file

@ -13,11 +13,11 @@ class Collator2 extends Collator{
$c = new Collator2(); $c = new Collator2();
$a = array('a', 'b'); $a = array('a', 'b');
try {
$c->sortWithSortKeys($a); $c->sortWithSortKeys($a);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?> ?>
--EXPECTF-- --EXPECT--
Fatal error: Uncaught Error: Object not initialized in %s:%d Error: Object not initialized
Stack trace:
#0 %s(%d): Collator->sortWithSortKeys(Array)
#1 {main}
thrown in %s on line %d

View file

@ -6,7 +6,6 @@ date.timezone=Atlantic/Azores
intl intl
--FILE-- --FILE--
<?php <?php
ini_set('intl.error_level', E_WARNING);
$x = new IntlDateFormatter('en', 1, 1); $x = new IntlDateFormatter('en', 1, 1);
try { try {
var_dump($x->__construct('en', 1, 1)); var_dump($x->__construct('en', 1, 1));

View file

@ -2,12 +2,11 @@
IntlCalendar::add() basic test IntlCalendar::add() basic test
--INI-- --INI--
date.timezone=Atlantic/Azores date.timezone=Atlantic/Azores
intl.default_locale=nl
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$time = strtotime('2012-02-29 00:00:00 +0000'); $time = strtotime('2012-02-29 00:00:00 +0000');
$time2 = strtotime('2012-03-01 05:06:07 +0000'); $time2 = strtotime('2012-03-01 05:06:07 +0000');

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::add(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_add(1, 2, 3));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_add(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_add(1, 2, 3)
#1 {main}
thrown in %s on line %d

View file

@ -1,77 +0,0 @@
--TEST--
IntlCalendar::before()/after(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$c = new IntlGregorianCalendar(NULL, 'pt_PT');
function eh($errno, $errstr) {
echo "error: $errno, $errstr\n";
}
set_error_handler('eh');
try {
var_dump($c->after());
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->before());
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->after(1));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->before(1));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try{
var_dump($c->after($c, 1));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->before($c, 1));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump(intlcal_after($c));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump(intlcal_before($c));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
?>
--EXPECT--
error: 0, IntlCalendar::after() expects exactly 1 argument, 0 given
error: 0, IntlCalendar::before() expects exactly 1 argument, 0 given
error: 0, IntlCalendar::after(): Argument #1 ($other) must be of type IntlCalendar, int given
error: 0, IntlCalendar::before(): Argument #1 ($other) must be of type IntlCalendar, int given
error: 0, IntlCalendar::after() expects exactly 1 argument, 2 given
error: 0, IntlCalendar::before() expects exactly 1 argument, 2 given
error: 0, intlcal_after() expects exactly 2 arguments, 1 given
error: 0, intlcal_before() expects exactly 2 arguments, 1 given

View file

@ -2,10 +2,10 @@
IntlCalendar::clear() basic test IntlCalendar::clear() basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
var_dump($intlcal->clear()); var_dump($intlcal->clear());

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
IntlCalendar::clear(): bad arguments IntlCalendar::clear(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
@ -20,13 +18,7 @@ try {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_clear(1, 2));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
IntlCalendar::clear(): Argument #1 ($field) must be a valid field IntlCalendar::clear(): Argument #1 ($field) must be a valid field
intlcal_clear(): Argument #2 ($field) must be a valid field intlcal_clear(): Argument #2 ($field) must be a valid field
intlcal_clear(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
IntlCalendar::clear() 1 arg variation IntlCalendar::clear() 1 arg variation
--INI-- --INI--
date.timezone=Atlantic/Azores intl.default_locale=nl
--EXTENSIONS-- --EXTENSIONS--
intl intl
--SKIPIF-- --SKIPIF--
@ -12,16 +12,14 @@ if (version_compare(INTL_ICU_VERSION, '73.1') >= 0 && version_compare(INTL_ICU_V
?> ?>
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
$intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000); $intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000);
//print_R($intlcal);
var_dump($intlcal->isSet(IntlCalendar::FIELD_MONTH)); var_dump($intlcal->isSet(IntlCalendar::FIELD_MONTH));
var_dump($intlcal->clear(IntlCalendar::FIELD_MONTH)); var_dump($intlcal->clear(IntlCalendar::FIELD_MONTH));
var_dump($intlcal->isSet(IntlCalendar::FIELD_MONTH)); var_dump($intlcal->isSet(IntlCalendar::FIELD_MONTH));
//print_R($intlcal);
var_dump( var_dump(
$intlcal->getTime(), $intlcal->getTime(),
strtotime('2012-01-29 05:06:07 +0000') * 1000. strtotime('2012-01-29 05:06:07 +0000') * 1000.

View file

@ -2,12 +2,11 @@
IntlCalendar::createInstance() basic test IntlCalendar::createInstance() basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
date.timezone=Europe/Amsterdam
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
date_default_timezone_set('Europe/Amsterdam');
$cal = IntlCalendar::createInstance(); $cal = IntlCalendar::createInstance();
print_R($cal->getTimeZone()); print_R($cal->getTimeZone());

View file

@ -4,7 +4,6 @@ IntlCalendar::createInstance: bad arguments
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
class X extends IntlTimeZone { class X extends IntlTimeZone {
function __construct() {} function __construct() {}

View file

@ -2,12 +2,11 @@
IntlCalendar::createInstance() argument variations IntlCalendar::createInstance() argument variations
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
date.timezone=Europe/Amsterdam
intl.default_locale=nl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
date_default_timezone_set('Europe/Amsterdam');
$cal = intlcal_create_instance('Europe/Amsterdam'); $cal = intlcal_create_instance('Europe/Amsterdam');
print_R($cal->getTimeZone()); print_R($cal->getTimeZone());

View file

@ -2,12 +2,11 @@
IntlCalendar::equals(), ::before() and ::after() basic test IntlCalendar::equals(), ::before() and ::after() basic test
--INI-- --INI--
date.timezone=Atlantic/Azores date.timezone=Atlantic/Azores
intl.default_locale=nl
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal1 = IntlGregorianCalendar::createFromDateTime(2012, 1, 29, 16, 59, 59); $intlcal1 = IntlGregorianCalendar::createFromDateTime(2012, 1, 29, 16, 59, 59);
$intlcal2 = IntlCalendar::createInstance(null, '@calendar=japanese'); $intlcal2 = IntlCalendar::createInstance(null, '@calendar=japanese');

View file

@ -1,55 +0,0 @@
--TEST--
IntlCalendar::equals(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$c = new IntlGregorianCalendar(NULL, 'pt_PT');
function eh($errno, $errstr) {
echo "error: $errno, $errstr\n";
}
set_error_handler('eh');
try {
var_dump($c->equals());
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->equals(new stdclass));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->equals(1, 2));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump(intlcal_equals($c, array()));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump(intlcal_equals(1, $c));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
?>
--EXPECT--
error: 0, IntlCalendar::equals() expects exactly 1 argument, 0 given
error: 0, IntlCalendar::equals(): Argument #1 ($other) must be of type IntlCalendar, stdClass given
error: 0, IntlCalendar::equals() expects exactly 1 argument, 2 given
error: 0, intlcal_equals(): Argument #2 ($other) must be of type IntlCalendar, array given
error: 0, intlcal_equals(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -2,12 +2,11 @@
IntlCalendar::fieldDifference() basic test IntlCalendar::fieldDifference() basic test
--INI-- --INI--
date.timezone=Atlantic/Azores date.timezone=Atlantic/Azores
intl.default_locale=nl
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
$intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000); $intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000);

View file

@ -1,38 +1,16 @@
--TEST-- --TEST--
IntlCalendar::fieldDifference(): bad arguments IntlCalendar::fieldDifference(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
$c = new IntlGregorianCalendar(NULL, 'pt_PT'); $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->fieldDifference($c, 2, 3));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
var_dump($c->fieldDifference(INF, 2)); var_dump($c->fieldDifference(INF, 2));
var_dump($c->getErrorMessage());
try {
var_dump(intlcal_field_difference($c, 0, 1, 2));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
var_dump(intlcal_field_difference(1, 0, 1));
?> ?>
--EXPECTF-- --EXPECT--
IntlCalendar::fieldDifference() expects exactly 2 arguments, 3 given
Warning: IntlCalendar::fieldDifference(): Call to ICU method has failed in %s on line %d
bool(false) bool(false)
intlcal_field_difference() expects exactly 3 arguments, 4 given string(88) "IntlCalendar::fieldDifference(): Call to ICU method has failed: U_ILLEGAL_ARGUMENT_ERROR"
Fatal error: Uncaught TypeError: intlcal_field_difference(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_field_difference(1, 0, 1)
#1 {main}
thrown in %s on line %d

View file

@ -2,11 +2,11 @@
IntlCalendar::fromDateTime(): basic test IntlCalendar::fromDateTime(): basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl_NL
date.timezone=Europe/Lisbon
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl_NL");
date_default_timezone_set('Europe/Lisbon');
$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00 Europe/Rome'); $cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00 Europe/Rome');
var_dump( var_dump(

View file

@ -2,36 +2,39 @@
IntlCalendar::fromDateTime(): errors IntlCalendar::fromDateTime(): errors
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
date.timezone=Europe/Lisbon
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
date_default_timezone_set('Europe/Lisbon');
try { try {
IntlCalendar::fromDateTime("foobar"); IntlCalendar::fromDateTime("foobar");
} catch (Exception $e) { } catch (Throwable $e) {
echo "threw exception, OK"; echo $e::class, ': ', $e->getMessage(), PHP_EOL;
} }
class A extends DateTime { class A extends DateTime {
function __construct() {} function __construct() {}
} }
var_dump(IntlCalendar::fromDateTime(new A)); var_dump(IntlCalendar::fromDateTime(new A));
var_dump(intl_get_error_message());
$date = new DateTime('2012-01-01 00:00:00 +24:00'); $date = new DateTime('2012-01-01 00:00:00 +24:00');
var_dump(IntlCalendar::fromDateTime($date)); var_dump(IntlCalendar::fromDateTime($date));
var_dump(intl_get_error_message());
$date = new DateTime('2012-01-01 00:00:00 WEST'); $date = new DateTime('2012-01-01 00:00:00 WEST');
var_dump(IntlCalendar::fromDateTime($date)); var_dump(IntlCalendar::fromDateTime($date));
var_dump(intl_get_error_message());
?> ?>
--EXPECTF-- --EXPECT--
threw exception, OK DateMalformedStringException: Failed to parse time string (foobar) at position 0 (f): The timezone could not be found in the database
Warning: IntlCalendar::fromDateTime(): DateTime object is unconstructed in %s on line %d
NULL NULL
string(88) "IntlCalendar::fromDateTime(): DateTime object is unconstructed: U_ILLEGAL_ARGUMENT_ERROR"
Warning: IntlCalendar::fromDateTime(): object has an time zone offset that's too large in %s on line %d
NULL NULL
string(103) "IntlCalendar::fromDateTime(): object has an time zone offset that's too large: U_ILLEGAL_ARGUMENT_ERROR"
Warning: IntlCalendar::fromDateTime(): time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d
NULL NULL
string(127) "IntlCalendar::fromDateTime(): time zone id 'WEST' extracted from ext/date DateTimeZone not recognized: U_ILLEGAL_ARGUMENT_ERROR"

View file

@ -2,10 +2,10 @@
IntlCalendar::getAvailableLocales() basic test IntlCalendar::getAvailableLocales() basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$locales = IntlCalendar::getAvailableLocales(); $locales = IntlCalendar::getAvailableLocales();
var_dump(count($locales) > 100); var_dump(count($locales) > 100);

View file

@ -1,13 +1,9 @@
--TEST-- --TEST--
IntlCalendar::getDayOfWeekType() basic test IntlCalendar::getDayOfWeekType() basic test
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
$intlcal->setTime(strtotime('2012-02-29 00:00:00 +0000') * 1000); $intlcal->setTime(strtotime('2012-02-29 00:00:00 +0000') * 1000);

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
IntlCalendar::getDayOfWeekOfType(): bad arguments IntlCalendar::getDayOfWeekOfType(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
@ -14,12 +12,6 @@ try {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_get_day_of_week_type(1, 1));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
IntlCalendar::getDayOfWeekType(): Argument #1 ($dayOfWeek) must be a valid day of the week IntlCalendar::getDayOfWeekType(): Argument #1 ($dayOfWeek) must be a valid day of the week
intlcal_get_day_of_week_type(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getErrorCode(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_error_code(null));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_error_code(): Argument #1 ($calendar) must be of type IntlCalendar, null given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_error_code(NULL)
#1 {main}
thrown in %s on line %d

View file

@ -2,12 +2,11 @@
IntlCalendar::getErrorCode(), ::getErrorMessage() basic test IntlCalendar::getErrorCode(), ::getErrorMessage() basic test
--INI-- --INI--
date.timezone=Atlantic/Azores date.timezone=Atlantic/Azores
intl.default_locale=nl
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlGregorianCalendar::createFromDate(2012, 1, 29); $intlcal = IntlGregorianCalendar::createFromDate(2012, 1, 29);
var_dump( var_dump(
@ -26,13 +25,11 @@ var_dump(
intlcal_get_error_message($intlcal) intlcal_get_error_message($intlcal)
); );
?> ?>
--EXPECTF-- --EXPECT--
int(0) int(0)
int(0) int(0)
string(12) "U_ZERO_ERROR" string(12) "U_ZERO_ERROR"
string(12) "U_ZERO_ERROR" string(12) "U_ZERO_ERROR"
Warning: IntlCalendar::fieldDifference(): Call to ICU method has failed in %s on line %d
int(1) int(1)
int(1) int(1)
string(88) "IntlCalendar::fieldDifference(): Call to ICU method has failed: U_ILLEGAL_ARGUMENT_ERROR" string(88) "IntlCalendar::fieldDifference(): Call to ICU method has failed: U_ILLEGAL_ARGUMENT_ERROR"

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getErrorMessage(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_error_message(null));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_error_message(): Argument #1 ($calendar) must be of type IntlCalendar, null given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_error_message(NULL)
#1 {main}
thrown in %s on line %d

View file

@ -2,10 +2,10 @@
IntlCalendar::getFirstDayOfWeek() basic test IntlCalendar::getFirstDayOfWeek() basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
var_dump($intlcal->getFirstDayOfWeek()); var_dump($intlcal->getFirstDayOfWeek());

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getFirstDayOfWeek(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_first_day_of_week(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_first_day_of_week(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_first_day_of_week(1)
#1 {main}
thrown in %s on line %d

View file

@ -4,27 +4,20 @@ IntlCalendar::getKeywordValuesForLocale() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
print_r( var_dump(iterator_to_array(IntlCalendar::getKeywordValuesForLocale('calendar', 'pt', true)));
iterator_to_array(
IntlCalendar::getKeywordValuesForLocale('calendar', 'pt', true)
));
echo "\n"; echo "\n";
$var = iterator_to_array( $var = iterator_to_array(intlcal_get_keyword_values_for_locale('calendar', 'pt', false));
intlcal_get_keyword_values_for_locale('calendar', 'pt', false)
);
var_dump(count($var) > 8); var_dump(count($var) > 8);
var_dump(in_array('japanese', $var)); var_dump(in_array('japanese', $var));
?> ?>
--EXPECT-- --EXPECT--
Array array(1) {
( [0]=>
[0] => gregorian string(9) "gregorian"
) }
bool(true) bool(true)
bool(true) bool(true)

View file

@ -2,10 +2,10 @@
IntlCalendar::getLocale() basic test IntlCalendar::getLocale() basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
var_dump($intlcal->getLocale(Locale::ACTUAL_LOCALE)); var_dump($intlcal->getLocale(Locale::ACTUAL_LOCALE));

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getLocale(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_locale(1));
?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: intlcal_get_locale() expects exactly 2 arguments, 1 given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_locale(1)
#1 {main}
thrown in %s on line %d

View file

@ -2,10 +2,10 @@
IntlCalendar::getMinimalDaysInFirstWeek() basic test IntlCalendar::getMinimalDaysInFirstWeek() basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
var_dump($intlcal->getMinimalDaysInFirstWeek()); var_dump($intlcal->getMinimalDaysInFirstWeek());

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getMinimalDaysInFirstWeek(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_minimal_days_in_first_week(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_minimal_days_in_first_week(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_minimal_days_in_first_week(1)
#1 {main}
thrown in %s on line %d

View file

@ -4,8 +4,6 @@ IntlCalendar::getNow() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$now = IntlCalendar::getNow(); $now = IntlCalendar::getNow();
$proc_now = intlcal_get_now(); $proc_now = intlcal_get_now();

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getSkipped/RepeatedWallTimeOption(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_skipped_wall_time_option(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_skipped_wall_time_option(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_skipped_wall_time_option(1)
#1 {main}
thrown in %s on line %d

View file

@ -4,8 +4,6 @@ IntlCalendar::getTimeZone() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('GMT+00:01'); $intlcal = IntlCalendar::createInstance('GMT+00:01');
print_r($intlcal->getTimeZone()); print_r($intlcal->getTimeZone());

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getTimeZone(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_time_zone(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_time_zone(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_time_zone(1)
#1 {main}
thrown in %s on line %d

View file

@ -1,13 +1,9 @@
--TEST-- --TEST--
IntlCalendar::getTime() basic test IntlCalendar::getTime() basic test
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
$intlcal->clear(); $intlcal->clear();

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getTime(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_time(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_time(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_time(1)
#1 {main}
thrown in %s on line %d

View file

@ -1,18 +1,14 @@
--TEST-- --TEST--
IntlCalendar::getType() basic test IntlCalendar::getType() basic test
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance(); $intlcal = IntlCalendar::createInstance();
VAR_DUMP($intlcal->getType()); var_dump($intlcal->getType());
$intlcal = IntlCalendar::createInstance(null, "nl_NL@calendar=hebrew"); $intlcal = IntlCalendar::createInstance(null, "nl_NL@calendar=hebrew");
VAR_DUMP(intlcal_get_type($intlcal)); var_dump(intlcal_get_type($intlcal));
?> ?>
--EXPECT-- --EXPECT--
string(9) "gregorian" string(9) "gregorian"

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::getType(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_type(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_type(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_type(1)
#1 {main}
thrown in %s on line %d

View file

@ -6,8 +6,6 @@ date.timezone=Atlantic/Azores
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance(); $intlcal = IntlCalendar::createInstance();
var_dump($intlcal->getWeekendTransition(IntlCalendar::DOW_SUNDAY)); var_dump($intlcal->getWeekendTransition(IntlCalendar::DOW_SUNDAY));

View file

@ -1,12 +1,9 @@
--TEST-- --TEST--
IntlCalendar::getWeekendTransition(): bad arguments IntlCalendar::getWeekendTransition(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
$c = new IntlGregorianCalendar(NULL, 'pt_PT'); $c = new IntlGregorianCalendar(NULL, 'pt_PT');
@ -16,13 +13,6 @@ try {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_get_weekend_transition(1, 1));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
IntlCalendar::getWeekendTransition(): Argument #1 ($dayOfWeek) must be a valid day of the week IntlCalendar::getWeekendTransition(): Argument #1 ($dayOfWeek) must be a valid day of the week
intlcal_get_weekend_transition(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -1,13 +1,9 @@
--TEST-- --TEST--
IntlCalendar::getMaximum(), ::getActualMaximum(), ::getLeastMaximum() basic test IntlCalendar::getMaximum(), ::getActualMaximum(), ::getLeastMaximum() basic test
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
$intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000); $intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000);

View file

@ -1,13 +1,9 @@
--TEST-- --TEST--
IntlCalendar::getMinimum(), ::getActualMinimum(), ::getGreatestMinimum() basic test IntlCalendar::getMinimum(), ::getActualMinimum(), ::getGreatestMinimum() basic test
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
$intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000); $intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000);

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
IntlCalendar::get/Least/Greatest/Minimum/Maximum(): bad arguments IntlCalendar::get/Least/Greatest/Minimum/Maximum(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
@ -51,26 +49,6 @@ try {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_get_least_maximum(1, 1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_maximum(1, 1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_greatest_minimum(1, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_minimum(1, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
ValueError: 0, IntlCalendar::getLeastMaximum(): Argument #1 ($field) must be a valid field ValueError: 0, IntlCalendar::getLeastMaximum(): Argument #1 ($field) must be a valid field
@ -81,7 +59,3 @@ ValueError: 0, intlcal_get_least_maximum(): Argument #2 ($field) must be a valid
ValueError: 0, intlcal_get_maximum(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_greatest_minimum(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_greatest_minimum(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_minimum(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_minimum(): Argument #2 ($field) must be a valid field
TypeError: 0, intlcal_get_least_maximum(): Argument #1 ($calendar) must be of type IntlCalendar, int given
TypeError: 0, intlcal_get_maximum(): Argument #1 ($calendar) must be of type IntlCalendar, int given
TypeError: 0, intlcal_get_greatest_minimum(): Argument #1 ($calendar) must be of type IntlCalendar, int given
TypeError: 0, intlcal_get_minimum(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -4,8 +4,6 @@ IntlCalendar::get() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
$intlcal->set(IntlCalendar::FIELD_DAY_OF_MONTH, 4); $intlcal->set(IntlCalendar::FIELD_DAY_OF_MONTH, 4);

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
IntlCalendar::get/getActualMaximum/getActualMinimum(): bad arguments IntlCalendar::get/getActualMaximum/getActualMinimum(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
IntlCalendar::get/getActualMaximum/getActualMinimum(): bad arguments (procedural) IntlCalendar::get/getActualMaximum/getActualMinimum(): bad arguments (procedural)
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
@ -9,22 +7,6 @@ intl
$c = new IntlGregorianCalendar(NULL, 'pt_PT'); $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump(intlcal_get($c));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_actual_maximum($c));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_actual_minimum($c));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try { try {
var_dump(intlcal_get($c, -1)); var_dump(intlcal_get($c, -1));
} catch (Error $e) { } catch (Error $e) {
@ -41,48 +23,8 @@ try {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_get($c, "s"));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_actual_maximum($c, "s"));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_actual_minimum($c, "s"));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get(1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_actual_maximum(1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_get_actual_minimum(1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
ArgumentCountError: 0, intlcal_get() expects exactly 2 arguments, 1 given
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 arguments, 1 given
ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 arguments, 1 given
ValueError: 0, intlcal_get(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field
TypeError: 0, intlcal_get(): Argument #2 ($field) must be of type int, string given
TypeError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be of type int, string given
TypeError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be of type int, string given
ArgumentCountError: 0, intlcal_get() expects exactly 2 arguments, 1 given
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 arguments, 1 given
ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 arguments, 1 given

View file

@ -2,12 +2,11 @@
IntlCalendar::get/setRepeatedWallTimeOption(): basic test IntlCalendar::get/setRepeatedWallTimeOption(): basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
date.timezone=Europe/Amsterdam
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
date_default_timezone_set('Europe/Amsterdam');
//28 October 2012, transition from DST //28 October 2012, transition from DST
$intlcal = IntlGregorianCalendar::createFromDateTime(2012, 9, 28, 0, 0, 0); $intlcal = IntlGregorianCalendar::createFromDateTime(2012, 9, 28, 0, 0, 0);

View file

@ -2,12 +2,11 @@
IntlCalendar::get/setSkippedWallTimeOption(): basic test IntlCalendar::get/setSkippedWallTimeOption(): basic test
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
intl.default_locale=nl
date.timezone=Europe/Amsterdam
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
date_default_timezone_set('Europe/Amsterdam');
//25 March 2012, transition to DST //25 March 2012, transition to DST
$intlcal = new IntlGregorianCalendar(2012, 2, 25, 0, 0, 0); $intlcal = new IntlGregorianCalendar(2012, 2, 25, 0, 0, 0);

View file

@ -1,13 +1,9 @@
--TEST-- --TEST--
IntlCalendar::inDaylightTime() basic test IntlCalendar::inDaylightTime() basic test
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('Europe/Amsterdam'); $intlcal = IntlCalendar::createInstance('Europe/Amsterdam');
$intlcal->setTime(strtotime('2012-01-01') * 1000); $intlcal->setTime(strtotime('2012-01-01') * 1000);

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::inDaylightTime(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_in_daylight_time(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_in_daylight_time(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_in_daylight_time(1)
#1 {main}
thrown in %s on line %d

View file

@ -4,8 +4,6 @@ IntlCalendar::isEquivalentTo() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal1 = IntlCalendar::createInstance('Europe/Amsterdam'); $intlcal1 = IntlCalendar::createInstance('Europe/Amsterdam');
$intlcal2 = IntlCalendar::createInstance('Europe/Lisbon'); $intlcal2 = IntlCalendar::createInstance('Europe/Lisbon');

View file

@ -1,61 +0,0 @@
--TEST--
IntlCalendar::isEquivalentTo(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$c = new IntlGregorianCalendar(NULL, 'pt_PT');
function eh($errno, $errstr) {
echo "error: $errno, $errstr\n";
}
set_error_handler('eh');
try {
var_dump($c->isEquivalentTo(0));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->isEquivalentTo($c, 1));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->isEquivalentTo(1));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump(intlcal_is_equivalent_to($c));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump(intlcal_is_equivalent_to($c, 1));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump(intlcal_is_equivalent_to(1, $c));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
?>
--EXPECT--
error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($other) must be of type IntlCalendar, int given
error: 0, IntlCalendar::isEquivalentTo() expects exactly 1 argument, 2 given
error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($other) must be of type IntlCalendar, int given
error: 0, intlcal_is_equivalent_to() expects exactly 2 arguments, 1 given
error: 0, intlcal_is_equivalent_to(): Argument #2 ($other) must be of type IntlCalendar, int given
error: 0, intlcal_is_equivalent_to(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::isLenient(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_is_lenient(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_is_lenient(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_is_lenient(1)
#1 {main}
thrown in %s on line %d

View file

@ -4,8 +4,6 @@ IntlCalendar::isSet() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
var_dump($intlcal->isSet(IntlCalendar::FIELD_MINUTE)); var_dump($intlcal->isSet(IntlCalendar::FIELD_MINUTE));

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
IntlCalendar::isSet(): bad arguments IntlCalendar::isSet(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
@ -15,12 +13,6 @@ try {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_is_set(1, 2));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
IntlCalendar::isSet(): Argument #1 ($field) must be a valid field IntlCalendar::isSet(): Argument #1 ($field) must be a valid field
intlcal_is_set(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -1,13 +1,9 @@
--TEST-- --TEST--
IntlCalendar::isWeekend basic test IntlCalendar::isWeekend basic test
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
var_dump($intlcal->isWeekend(strtotime('2012-02-29 12:00:00 +0000') * 1000)); var_dump($intlcal->isWeekend(strtotime('2012-02-29 12:00:00 +0000') * 1000));

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::isWeekend(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_is_weekend(1));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_is_weekend(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_is_weekend(1)
#1 {main}
thrown in %s on line %d

View file

@ -4,8 +4,6 @@ IntlCalendar::isLenient(), ::setLenient() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal1 = IntlCalendar::createInstance('UTC'); $intlcal1 = IntlCalendar::createInstance('UTC');
var_dump($intlcal1->isLenient()); var_dump($intlcal1->isLenient());

View file

@ -6,8 +6,6 @@ date.timezone=Atlantic/Azores
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = new IntlGregorianCalendar(2012, 1, 28); $intlcal = new IntlGregorianCalendar(2012, 1, 28);
var_dump($intlcal->roll(IntlCalendar::FIELD_DAY_OF_MONTH, 2)); var_dump($intlcal->roll(IntlCalendar::FIELD_DAY_OF_MONTH, 2));

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
IntlCalendar::roll(): bad arguments IntlCalendar::roll(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
@ -15,12 +13,6 @@ try {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_roll(1, 2, 3));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
IntlCalendar::roll(): Argument #1 ($field) must be a valid field IntlCalendar::roll(): Argument #1 ($field) must be a valid field
intlcal_roll(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -6,8 +6,6 @@ date.timezone=Atlantic/Azores
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = new IntlGregorianCalendar(2012, 1, 28); $intlcal = new IntlGregorianCalendar(2012, 1, 28);
var_dump($intlcal->roll(IntlCalendar::FIELD_DAY_OF_MONTH, true)); var_dump($intlcal->roll(IntlCalendar::FIELD_DAY_OF_MONTH, true));

View file

@ -4,8 +4,6 @@ IntlCalendar::setFirstDayOfWeek() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
var_dump( var_dump(

View file

@ -20,14 +20,8 @@ try {
} catch (\ValueError $e) { } catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_set_first_day_of_week(1, 2));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
IntlCalendar::setFirstDayOfWeek(): Argument #1 ($dayOfWeek) must be a valid day of the week IntlCalendar::setFirstDayOfWeek(): Argument #1 ($dayOfWeek) must be a valid day of the week
intlcal_set_first_day_of_week(): Argument #2 ($dayOfWeek) must be a valid day of the week intlcal_set_first_day_of_week(): Argument #2 ($dayOfWeek) must be a valid day of the week
intlcal_set_first_day_of_week(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -1,18 +0,0 @@
--TEST--
IntlCalendar::setLenient(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_set_lenient(1, false));
?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_set_lenient(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
#0 %s(%d): intlcal_set_lenient(1, false)
#1 {main}
thrown in %s on line %d

View file

@ -4,8 +4,6 @@ IntlCalendar::setMinimalDaysInFirstWeek() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('UTC'); $intlcal = IntlCalendar::createInstance('UTC');
var_dump( var_dump(

View file

@ -1,7 +1,5 @@
--TEST-- --TEST--
IntlCalendar::setMinimalDaysInFirstWeek(): bad arguments IntlCalendar::setMinimalDaysInFirstWeek(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
@ -20,14 +18,8 @@ try {
} catch (\ValueError $e) { } catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_set_minimal_days_in_first_week(1, 2));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
IntlCalendar::setMinimalDaysInFirstWeek(): Argument #1 ($days) must be between 1 and 7 IntlCalendar::setMinimalDaysInFirstWeek(): Argument #1 ($days) must be between 1 and 7
intlcal_set_minimal_days_in_first_week(): Argument #2 ($days) must be between 1 and 7 intlcal_set_minimal_days_in_first_week(): Argument #2 ($days) must be between 1 and 7
intlcal_set_minimal_days_in_first_week(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -1,12 +1,9 @@
--TEST-- --TEST--
IntlCalendar::setSkipped/RepeatedWallTimeOption(): bad arguments IntlCalendar::setSkipped/RepeatedWallTimeOption(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
$c = new IntlGregorianCalendar(NULL, 'pt_PT'); $c = new IntlGregorianCalendar(NULL, 'pt_PT');
@ -21,13 +18,7 @@ try {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try {
var_dump(intlcal_set_repeated_wall_time_option(1, 1));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?> ?>
--EXPECT-- --EXPECT--
IntlCalendar::setSkippedWallTimeOption(): Argument #1 ($option) must be one of IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST, or IntlCalendar::WALLTIME_NEXT_VALID IntlCalendar::setSkippedWallTimeOption(): Argument #1 ($option) must be one of IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST, or IntlCalendar::WALLTIME_NEXT_VALID
IntlCalendar::setRepeatedWallTimeOption(): Argument #1 ($option) must be either IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST IntlCalendar::setRepeatedWallTimeOption(): Argument #1 ($option) must be either IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST
intlcal_set_repeated_wall_time_option(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -4,8 +4,6 @@ IntlCalendar::setTimeZone() basic test
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('Europe/Amsterdam'); $intlcal = IntlCalendar::createInstance('Europe/Amsterdam');
print_r($intlcal->getTimeZone()->getID()); print_r($intlcal->getTimeZone()->getID());

View file

@ -1,49 +0,0 @@
--TEST--
IntlCalendar::setTimeZone(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS--
intl
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$c = new IntlGregorianCalendar(NULL, 'pt_PT');
$gmt = IntlTimeZone::getGMT();
function eh($errno, $errstr) {
echo "error: $errno, $errstr\n";
}
set_error_handler('eh');
try {
var_dump($c->setTimeZone($gmt, 2));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try {
var_dump($c->setTimeZone());
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try{
var_dump(intlcal_set_time_zone($c, 1, 2));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
try{
var_dump(intlcal_set_time_zone(1, $gmt));
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
?>
--EXPECT--
error: 0, IntlCalendar::setTimeZone() expects exactly 1 argument, 2 given
error: 0, IntlCalendar::setTimeZone() expects exactly 1 argument, 0 given
error: 0, intlcal_set_time_zone() expects exactly 2 arguments, 3 given
error: 0, intlcal_set_time_zone(): Argument #1 ($calendar) must be of type IntlCalendar, int given

View file

@ -2,25 +2,28 @@
IntlCalendar::setTimeZone(): valid time zones for DateTime but not ICU IntlCalendar::setTimeZone(): valid time zones for DateTime but not ICU
--EXTENSIONS-- --EXTENSIONS--
intl intl
--INI--
date.timezone=Europe/Amsterdam
intl.default_locale=nl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
date_default_timezone_set('Europe/Amsterdam');
$intlcal = new IntlGregorianCalendar(); $intlcal = new IntlGregorianCalendar();
$pstdate = new DateTime('2012-01-01 00:00:00 WEST'); $pstdate = new DateTime('2012-01-01 00:00:00 WEST');
$intlcal->setTimeZone($pstdate->getTimeZone()); var_dump($intlcal->setTimeZone($pstdate->getTimeZone()));
var_dump($intlcal->getErrorMessage());
var_dump($intlcal->getTimeZone()->getID()); var_dump($intlcal->getTimeZone()->getID());
$pstdate = new DateTime('2012-01-01 00:00:00 +24:00'); $pstdate = new DateTime('2012-01-01 00:00:00 +24:00');
$intlcal->setTimeZone($pstdate->getTimeZone()); var_dump($intlcal->setTimeZone($pstdate->getTimeZone()));
var_dump($intlcal->getErrorMessage());
var_dump($intlcal->getTimeZone()->getID()); var_dump($intlcal->getTimeZone()->getID());
?> ?>
--EXPECTF-- --EXPECT--
Warning: IntlCalendar::setTimeZone(): time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d bool(false)
string(126) "IntlCalendar::setTimeZone(): time zone id 'WEST' extracted from ext/date DateTimeZone not recognized: U_ILLEGAL_ARGUMENT_ERROR"
string(16) "Europe/Amsterdam" string(16) "Europe/Amsterdam"
bool(false)
Warning: IntlCalendar::setTimeZone(): object has an time zone offset that's too large in %s on line %d string(102) "IntlCalendar::setTimeZone(): object has an time zone offset that's too large: U_ILLEGAL_ARGUMENT_ERROR"
string(16) "Europe/Amsterdam" string(16) "Europe/Amsterdam"

View file

@ -4,8 +4,6 @@ IntlCalendar::setTimeZone() variation with NULL arg
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$intlcal = IntlCalendar::createInstance('Europe/Amsterdam'); $intlcal = IntlCalendar::createInstance('Europe/Amsterdam');
print_r($intlcal->getTimeZone()->getID()); print_r($intlcal->getTimeZone()->getID());

View file

@ -4,9 +4,6 @@ IntlCalendar::setTimeZone(): different ways to specify time zone
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
date_default_timezone_set('Europe/Amsterdam');
$intlcal = new IntlGregorianCalendar(); $intlcal = new IntlGregorianCalendar();
$intlcal->setTimeZone('Europe/Paris'); $intlcal->setTimeZone('Europe/Paris');

View file

@ -1,13 +1,9 @@
--TEST-- --TEST--
IntlCalendar::setTime() basic test IntlCalendar::setTime() basic test
--INI--
date.timezone=Atlantic/Azores
--EXTENSIONS-- --EXTENSIONS--
intl intl
--FILE-- --FILE--
<?php <?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "nl");
$time = strtotime('2012-02-29 00:00:00 +0000'); $time = strtotime('2012-02-29 00:00:00 +0000');

Some files were not shown because too many files have changed in this diff Show more