From: andy wharmby Date: Wed, 18 Mar 2009 11:13:01 +0000 (+0000) Subject: New tests for date extension DateTimeZone methods Tested on Windows, Linux and linux 64 X-Git-Tag: php-5.4.0alpha1~191^2~4113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84bd22c4eeb01ffdf323155399d60d5b741ae3aa;p=php New tests for date extension DateTimeZone methods Tested on Windows, Linux and linux 64 --- diff --git a/ext/date/tests/DateTimeZone_clone_basic1.phpt b/ext/date/tests/DateTimeZone_clone_basic1.phpt new file mode 100644 index 0000000000..6de5d4b463 --- /dev/null +++ b/ext/date/tests/DateTimeZone_clone_basic1.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test clone on DateTimeZone objects +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing clone on DateTime objects *** +object(DateTimeZone)#%d (0) { +} +object(DateTimeZone)#%d (0) { +} +TEST PASSED : Objects equal but not indetical +===DONE=== + + diff --git a/ext/date/tests/DateTimeZone_clone_basic2.phpt b/ext/date/tests/DateTimeZone_clone_basic2.phpt new file mode 100644 index 0000000000..c967ec3198 --- /dev/null +++ b/ext/date/tests/DateTimeZone_clone_basic2.phpt @@ -0,0 +1,66 @@ +--TEST-- +Testing clone on objects whoose class derived from DateTimeZone class +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing clone on objects whoose class derived from DateTimeZone class *** +object(DateTimeZoneExt1)#%d (2) { + [u"property1"]=> + int(99) + [u"property2"]=> + unicode(5) "Hello" +} +object(DateTimeZoneExt1)#%d (2) { + [u"property1"]=> + int(99) + [u"property2"]=> + unicode(5) "Hello" +} +object(DateTimeZoneExt2)#%d (4) { + [u"property3"]=> + bool(true) + [u"property4"]=> + float(10.5) + [u"property1"]=> + int(99) + [u"property2"]=> + unicode(5) "Hello" +} +object(DateTimeZoneExt2)#%d (4) { + [u"property3"]=> + bool(true) + [u"property4"]=> + float(10.5) + [u"property1"]=> + int(99) + [u"property2"]=> + unicode(5) "Hello" +} +===DONE=== diff --git a/ext/date/tests/DateTimeZone_clone_basic3.phpt b/ext/date/tests/DateTimeZone_clone_basic3.phpt new file mode 100644 index 0000000000..fa22302199 --- /dev/null +++ b/ext/date/tests/DateTimeZone_clone_basic3.phpt @@ -0,0 +1,75 @@ +--TEST-- +Test clone of DateTimeZOne objects +--FILE-- +property1 = 99; +$d1->property2 = "Hello"; +var_dump($d1); +echo "\n-- clone it --\n"; +$d1_clone = clone $d1; +var_dump($d1_clone); +echo "\n-- Add some more properties --\n"; +$d1_clone->property3 = true; +$d1_clone->property4 = 10.5; +var_dump($d1_clone); +echo "\n-- clone it --\n"; +$d2_clone = clone $d1_clone; +var_dump($d2_clone); +?> +===DONE=== +--EXPECTF-- +*** Testing clone on DateTime objects *** + +-- Create a DateTimeZone object -- +object(DateTimeZone)#%d (0) { +} + +-- Add some properties -- +object(DateTimeZone)#%d (2) { + [u"property1"]=> + int(99) + [u"property2"]=> + unicode(5) "Hello" +} + +-- clone it -- +object(DateTimeZone)#%d (2) { + [u"property1"]=> + int(99) + [u"property2"]=> + unicode(5) "Hello" +} + +-- Add some more properties -- +object(DateTimeZone)#%d (4) { + [u"property1"]=> + int(99) + [u"property2"]=> + unicode(5) "Hello" + [u"property3"]=> + bool(true) + [u"property4"]=> + float(10.5) +} + +-- clone it -- +object(DateTimeZone)#%d (4) { + [u"property1"]=> + int(99) + [u"property2"]=> + unicode(5) "Hello" + [u"property3"]=> + bool(true) + [u"property4"]=> + float(10.5) +} +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_clone_basic4.phpt b/ext/date/tests/DateTimeZone_clone_basic4.phpt new file mode 100644 index 0000000000..2bdab34ee1 --- /dev/null +++ b/ext/date/tests/DateTimeZone_clone_basic4.phpt @@ -0,0 +1,28 @@ +--TEST-- +Test clone of DateTimeZone derived objects with __clone magic method +--FILE-- +getName() ); + +?> +===DONE=== +--EXPECTF-- +*** Testing clone of objects derived from DateTimeZone class with __clone magic method*** +-- DateTimeExt1 __clone magic method called -- +unicode(16) "America/New_York" +===DONE=== diff --git a/ext/date/tests/DateTimeZone_compare_basic1.phpt b/ext/date/tests/DateTimeZone_compare_basic1.phpt new file mode 100644 index 0000000000..f3648cb243 --- /dev/null +++ b/ext/date/tests/DateTimeZone_compare_basic1.phpt @@ -0,0 +1,54 @@ +--TEST-- +Test of compare object handler for DateTime objects +--FILE-- + +===DONE=== +--EXPECT-- +Simple test for DateTimeZone compare object handler + +-- All the following tests should compare equal -- +bool(true) + +-- All the following tests should compare NOT equal -- +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_construct_basic.phpt b/ext/date/tests/DateTimeZone_construct_basic.phpt new file mode 100644 index 0000000000..b681e8f9c3 --- /dev/null +++ b/ext/date/tests/DateTimeZone_construct_basic.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test new DateTimeZone() : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing new DateTimeZone() : basic functionality *** +object(DateTimeZone)#%d (0) { +} +object(DateTimeZone)#%d (0) { +} +object(DateTimeZone)#%d (0) { +} +===DONE=== diff --git a/ext/date/tests/DateTimeZone_construct_error.phpt b/ext/date/tests/DateTimeZone_construct_error.phpt new file mode 100644 index 0000000000..e3e0fc466f --- /dev/null +++ b/ext/date/tests/DateTimeZone_construct_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test new DateTimeZone() : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing DateTimeZone() : error conditions *** + +-- Testing new DateTimeZone() with more than expected no. of arguments -- + +Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 2 given' in %s:%d +Stack trace: +#0 %s(%d): DateTimeZone->__construct('GMT', 99) +#1 {main} + thrown in %s on line %d + \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_construct_variation1.phpt b/ext/date/tests/DateTimeZone_construct_variation1.phpt new file mode 100644 index 0000000000..f8c4beddac --- /dev/null +++ b/ext/date/tests/DateTimeZone_construct_variation1.phpt @@ -0,0 +1,200 @@ +--TEST-- +Test DateTime::__construct() function : usage variation - Passing unexpected values to first argument $timezone. +--FILE-- + 1, 'two' => 2); + +// resource +$file_handle = fopen(__FILE__, 'r'); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -12345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // resource + 'resource' => $file_handle +); + +foreach($inputs as $variation =>$timezone) { + echo "\n-- $variation --\n"; + try { + var_dump( new DateTimezone($timezone) ); + } catch(Exception $e) { + $msg = $e->getMessage(); + echo "FAILED: " . $msg . "\n"; + } + +}; + +// closing the resource +fclose( $file_handle ); + +?> +===DONE=== +--EXPECTF-- +*** Testing DateTime::__construct() : usage variation - unexpected values to first argument $timezone*** + +-- int 0 -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (0) + +-- int 1 -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (1) + +-- int 12345 -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (12345) + +-- int -12345 -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (-12345) + +-- float 10.5 -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (10.5) + +-- float -10.5 -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (-10.5) + +-- float .5 -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (0.5) + +-- empty array -- +FAILED: DateTimeZone::__construct() expects parameter 1 to be binary string, array given + +-- int indexed array -- +FAILED: DateTimeZone::__construct() expects parameter 1 to be binary string, array given + +-- associative array -- +FAILED: DateTimeZone::__construct() expects parameter 1 to be binary string, array given + +-- nested arrays -- +FAILED: DateTimeZone::__construct() expects parameter 1 to be binary string, array given + +-- uppercase NULL -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone () + +-- lowercase null -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone () + +-- lowercase true -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (1) + +-- lowercase false -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone () + +-- uppercase TRUE -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (1) + +-- uppercase FALSE -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone () + +-- empty string DQ -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone () + +-- empty string SQ -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone () + +-- string DQ -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (string) + +-- string SQ -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (string) + +-- mixed case string -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (sTrInG) + +-- heredoc -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (hello world) + +-- instance of classWithToString -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone (Class A object) + +-- instance of classWithoutToString -- +FAILED: DateTimeZone::__construct() expects parameter 1 to be binary string, object given + +-- undefined var -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone () + +-- unset var -- +FAILED: DateTimeZone::__construct(): Unknown or bad timezone () + +-- resource -- +FAILED: DateTimeZone::__construct() expects parameter 1 to be binary string, resource given +===DONE=== diff --git a/ext/date/tests/DateTimeZone_extends_basic1.phpt b/ext/date/tests/DateTimeZone_extends_basic1.phpt new file mode 100644 index 0000000000..afc2ed64b2 --- /dev/null +++ b/ext/date/tests/DateTimeZone_extends_basic1.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test DateTimeZone class inheritance +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing basic DateTimeZone inheritance() *** + +-- Create an instance of DateTimeZoneExt -- + +-- Invoke __toString -- +America/Los_Angeles +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_getName_basic1.phpt b/ext/date/tests/DateTimeZone_getName_basic1.phpt new file mode 100644 index 0000000000..93c9b612b3 --- /dev/null +++ b/ext/date/tests/DateTimeZone_getName_basic1.phpt @@ -0,0 +1,32 @@ +--TEST-- +Test DateTimeZone::getName() function : basic functionality +--FILE-- +getName() ); + +$tz2 = new DateTimeZone("America/New_York"); +var_dump( $tz2->getName() ); + +$tz3 = new DateTimeZone("America/Los_Angeles"); +var_dump( $tz3->getName() ); + +?> +===DONE=== +--EXPECT-- +*** Testing DateTimeZone::getName() : basic functionality *** +unicode(13) "Europe/London" +unicode(16) "America/New_York" +unicode(19) "America/Los_Angeles" +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_getName_error.phpt b/ext/date/tests/DateTimeZone_getName_error.phpt new file mode 100644 index 0000000000..0a87b10069 --- /dev/null +++ b/ext/date/tests/DateTimeZone_getName_error.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test DateTimeZone::getName() function : error conditions +--FILE-- +getName($extra_arg) ); + +?> +===DONE=== +--EXPECTF-- +*** Testing DateTimeZone::getName() : error conditions *** + +-- Testing DateTimeZone::getName() function with more than expected no. of arguments -- + +Warning: DateTimeZone::getName() expects exactly 0 parameters, 1 given in %s on line %d +bool(false) +===DONE=== diff --git a/ext/date/tests/DateTimeZone_getOffset_basic1.phpt b/ext/date/tests/DateTimeZone_getOffset_basic1.phpt new file mode 100644 index 0000000000..46c0e6af6b --- /dev/null +++ b/ext/date/tests/DateTimeZone_getOffset_basic1.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test DateTimeZone::getOffset() function : basic functionality +--FILE-- +getOffset($date) ); + +$tz2 = new DateTimeZone("America/New_York"); +var_dump( $tz2->getOffset($date) ); + +$tz3 = new DateTimeZone("America/Los_Angeles"); +var_dump( $tz3->getOffset($date) ); + +?> +===DONE=== +--EXPECTF-- +*** Testing DateTimeZone::getOffset() : basic functionality *** +int(0) +%rint\(-18000\)|int\(-14400\)%r +%rint\(-28800\)|int\(-25200\)%r +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_getOffset_error.phpt b/ext/date/tests/DateTimeZone_getOffset_error.phpt new file mode 100644 index 0000000000..56e45b76d4 --- /dev/null +++ b/ext/date/tests/DateTimeZone_getOffset_error.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test DateTimeZone::getOffset() function : error conditions +--FILE-- +getOffset() ); + +echo "\n-- Testing DateTimeZone::getOffset() function with more than expected no. of arguments --\n"; +$extra_arg = 99; +var_dump( $tz->getOffset($date, $extra_arg) ); + +?> +===DONE=== +--EXPECTF-- +*** Testing DateTimeZone::getOffset() : error conditions *** + +-- Testing DateTimeZone::getOffset() function with zero arguments -- + +Warning: DateTimeZone::getOffset() expects exactly 1 parameter, 0 given in %s on line %d +bool(false) + +-- Testing DateTimeZone::getOffset() function with more than expected no. of arguments -- + +Warning: DateTimeZone::getOffset() expects exactly 1 parameter, 2 given in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt new file mode 100644 index 0000000000..426060c2a2 --- /dev/null +++ b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt @@ -0,0 +1,252 @@ +--TEST-- +Test DateTimeZone::getOffset() function : usage variation - Passing unexpected values to first argument $datetime. +--FILE-- + 1, 'two' => 2); + +// resource +$file_handle = fopen(__FILE__, 'r'); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -12345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // resource + 'resource' => $file_handle +); + +$timezone = new DateTimezone("Europe/London"); + +foreach($inputs as $variation =>$datetime) { + echo "\n-- $variation --\n"; + var_dump( $timezone->getOffset($datetime) ); +}; + +// closing the resource +fclose( $file_handle ); + +?> +===DONE=== +--EXPECTF-- +*** Testing DateTimeZone::getOffset() : usage variation - unexpected values to first argument $datetime*** + +-- int 0 -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +bool(false) + +-- int 1 -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +bool(false) + +-- int 12345 -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +bool(false) + +-- int -12345 -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +bool(false) + +-- float 10.5 -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +bool(false) + +-- float -10.5 -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +bool(false) + +-- float .5 -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +bool(false) + +-- empty array -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +bool(false) + +-- int indexed array -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +bool(false) + +-- associative array -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +bool(false) + +-- nested arrays -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +bool(false) + +-- uppercase NULL -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +bool(false) + +-- lowercase null -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +bool(false) + +-- lowercase true -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +bool(false) + +-- lowercase false -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +bool(false) + +-- uppercase TRUE -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +bool(false) + +-- uppercase FALSE -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +bool(false) + +-- empty string DQ -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, Unicode string given in %s on line %d +bool(false) + +-- empty string SQ -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, Unicode string given in %s on line %d +bool(false) + +-- string DQ -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, Unicode string given in %s on line %d +bool(false) + +-- string SQ -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, Unicode string given in %s on line %d +bool(false) + +-- mixed case string -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, Unicode string given in %s on line %d +bool(false) + +-- heredoc -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, Unicode string given in %s on line %d +bool(false) + +-- instance of classWithToString -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +bool(false) + +-- instance of classWithoutToString -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +bool(false) + +-- undefined var -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +bool(false) + +-- unset var -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +bool(false) + +-- resource -- + +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, resource given in %s on line %d +bool(false) +===DONE=== diff --git a/ext/date/tests/DateTimeZone_getTransitions_basic1.phpt b/ext/date/tests/DateTimeZone_getTransitions_basic1.phpt new file mode 100644 index 0000000000..eb57822e6e --- /dev/null +++ b/ext/date/tests/DateTimeZone_getTransitions_basic1.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test DateTimeZone::getTransitions() function : basic functionality +--FILE-- +getTransitions(); + +if (!is_array($tran)) { + echo "TEST FAILED: Expected an array\n"; +} + +echo "\n-- Total number of transitions: " . count($tran). " --\n"; + +echo "\n-- Format a sample entry for Spring 1963 --\n"; +var_dump( $tran[97] ); + +?> +===DONE=== +--EXPECT-- +*** Testing DateTimeZone::getTransitions() : basic functionality *** + +-- Total number of transitions: 243 -- + +-- Format a sample entry for Spring 1963 -- +array(5) { + [u"ts"]=> + int(-213228000) + [u"time"]=> + unicode(24) "1963-03-31T02:00:00+0000" + [u"offset"]=> + int(3600) + [u"isdst"]=> + bool(true) + [u"abbr"]=> + unicode(3) "BST" +} +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_getTransitions_error.phpt b/ext/date/tests/DateTimeZone_getTransitions_error.phpt new file mode 100644 index 0000000000..bfcd224ca7 --- /dev/null +++ b/ext/date/tests/DateTimeZone_getTransitions_error.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test DateTimeZone::getTransitions() function : error conditions +--FILE-- +getTransitions($timestamp_begin, $timestamp_end, $extra_arg) ); + +?> +===DONE=== +--EXPECTF-- +*** Testing DateTimeZone::getTransitions() : error conditions *** + +-- Testing DateTimeZone::getTransitions() function with more than expected no. of arguments -- + +Warning: DateTimeZone::getTransitions() expects at most 2 parameters, 3 given in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_listAbbreviations_basic1.phpt b/ext/date/tests/DateTimeZone_listAbbreviations_basic1.phpt new file mode 100644 index 0000000000..44ba1e41ca --- /dev/null +++ b/ext/date/tests/DateTimeZone_listAbbreviations_basic1.phpt @@ -0,0 +1,70 @@ +--TEST-- +Test DateTimeZone::listAbbreviations() function : basic functionality +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing DateTimeZone::listAbbreviations() : basic functionality *** +unicode(5) "array" +int(338) + +-- Format a sample entry -- +array(4) { + [0]=> + array(3) { + [u"dst"]=> + bool(true) + [u"offset"]=> + int(-14400) + [u"timezone_id"]=> + unicode(18) "America/Porto_Acre" + } + [1]=> + array(3) { + [u"dst"]=> + bool(true) + [u"offset"]=> + int(-14400) + [u"timezone_id"]=> + unicode(16) "America/Eirunepe" + } + [2]=> + array(3) { + [u"dst"]=> + bool(true) + [u"offset"]=> + int(-14400) + [u"timezone_id"]=> + unicode(18) "America/Rio_Branco" + } + [3]=> + array(3) { + [u"dst"]=> + bool(true) + [u"offset"]=> + int(-14400) + [u"timezone_id"]=> + unicode(11) "Brazil/Acre" + } +} +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_listIdentifiers_basic1.phpt b/ext/date/tests/DateTimeZone_listIdentifiers_basic1.phpt new file mode 100644 index 0000000000..5198f121f4 --- /dev/null +++ b/ext/date/tests/DateTimeZone_listIdentifiers_basic1.phpt @@ -0,0 +1,828 @@ +--TEST-- +Test DateTimeZone::listIdentifiers function : basic functionality +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing DateTimeZone::listIdentifiers() : basic functionality *** +array(402) { + [0]=> + unicode(14) "Africa/Abidjan" + [1]=> + unicode(12) "Africa/Accra" + [2]=> + unicode(18) "Africa/Addis_Ababa" + [3]=> + unicode(14) "Africa/Algiers" + [4]=> + unicode(13) "Africa/Asmara" + [5]=> + unicode(13) "Africa/Bamako" + [6]=> + unicode(13) "Africa/Bangui" + [7]=> + unicode(13) "Africa/Banjul" + [8]=> + unicode(13) "Africa/Bissau" + [9]=> + unicode(15) "Africa/Blantyre" + [10]=> + unicode(18) "Africa/Brazzaville" + [11]=> + unicode(16) "Africa/Bujumbura" + [12]=> + unicode(12) "Africa/Cairo" + [13]=> + unicode(17) "Africa/Casablanca" + [14]=> + unicode(12) "Africa/Ceuta" + [15]=> + unicode(14) "Africa/Conakry" + [16]=> + unicode(12) "Africa/Dakar" + [17]=> + unicode(20) "Africa/Dar_es_Salaam" + [18]=> + unicode(15) "Africa/Djibouti" + [19]=> + unicode(13) "Africa/Douala" + [20]=> + unicode(15) "Africa/El_Aaiun" + [21]=> + unicode(15) "Africa/Freetown" + [22]=> + unicode(15) "Africa/Gaborone" + [23]=> + unicode(13) "Africa/Harare" + [24]=> + unicode(19) "Africa/Johannesburg" + [25]=> + unicode(14) "Africa/Kampala" + [26]=> + unicode(15) "Africa/Khartoum" + [27]=> + unicode(13) "Africa/Kigali" + [28]=> + unicode(15) "Africa/Kinshasa" + [29]=> + unicode(12) "Africa/Lagos" + [30]=> + unicode(17) "Africa/Libreville" + [31]=> + unicode(11) "Africa/Lome" + [32]=> + unicode(13) "Africa/Luanda" + [33]=> + unicode(17) "Africa/Lubumbashi" + [34]=> + unicode(13) "Africa/Lusaka" + [35]=> + unicode(13) "Africa/Malabo" + [36]=> + unicode(13) "Africa/Maputo" + [37]=> + unicode(13) "Africa/Maseru" + [38]=> + unicode(14) "Africa/Mbabane" + [39]=> + unicode(16) "Africa/Mogadishu" + [40]=> + unicode(15) "Africa/Monrovia" + [41]=> + unicode(14) "Africa/Nairobi" + [42]=> + unicode(15) "Africa/Ndjamena" + [43]=> + unicode(13) "Africa/Niamey" + [44]=> + unicode(17) "Africa/Nouakchott" + [45]=> + unicode(18) "Africa/Ouagadougou" + [46]=> + unicode(17) "Africa/Porto-Novo" + [47]=> + unicode(15) "Africa/Sao_Tome" + [48]=> + unicode(14) "Africa/Tripoli" + [49]=> + unicode(12) "Africa/Tunis" + [50]=> + unicode(15) "Africa/Windhoek" + [51]=> + unicode(12) "America/Adak" + [52]=> + unicode(17) "America/Anchorage" + [53]=> + unicode(16) "America/Anguilla" + [54]=> + unicode(15) "America/Antigua" + [55]=> + unicode(17) "America/Araguaina" + [56]=> + unicode(30) "America/Argentina/Buenos_Aires" + [57]=> + unicode(27) "America/Argentina/Catamarca" + [58]=> + unicode(25) "America/Argentina/Cordoba" + [59]=> + unicode(23) "America/Argentina/Jujuy" + [60]=> + unicode(26) "America/Argentina/La_Rioja" + [61]=> + unicode(25) "America/Argentina/Mendoza" + [62]=> + unicode(30) "America/Argentina/Rio_Gallegos" + [63]=> + unicode(23) "America/Argentina/Salta" + [64]=> + unicode(26) "America/Argentina/San_Juan" + [65]=> + unicode(26) "America/Argentina/San_Luis" + [66]=> + unicode(25) "America/Argentina/Tucuman" + [67]=> + unicode(25) "America/Argentina/Ushuaia" + [68]=> + unicode(13) "America/Aruba" + [69]=> + unicode(16) "America/Asuncion" + [70]=> + unicode(16) "America/Atikokan" + [71]=> + unicode(13) "America/Bahia" + [72]=> + unicode(16) "America/Barbados" + [73]=> + unicode(13) "America/Belem" + [74]=> + unicode(14) "America/Belize" + [75]=> + unicode(20) "America/Blanc-Sablon" + [76]=> + unicode(17) "America/Boa_Vista" + [77]=> + unicode(14) "America/Bogota" + [78]=> + unicode(13) "America/Boise" + [79]=> + unicode(21) "America/Cambridge_Bay" + [80]=> + unicode(20) "America/Campo_Grande" + [81]=> + unicode(14) "America/Cancun" + [82]=> + unicode(15) "America/Caracas" + [83]=> + unicode(15) "America/Cayenne" + [84]=> + unicode(14) "America/Cayman" + [85]=> + unicode(15) "America/Chicago" + [86]=> + unicode(17) "America/Chihuahua" + [87]=> + unicode(18) "America/Costa_Rica" + [88]=> + unicode(14) "America/Cuiaba" + [89]=> + unicode(15) "America/Curacao" + [90]=> + unicode(20) "America/Danmarkshavn" + [91]=> + unicode(14) "America/Dawson" + [92]=> + unicode(20) "America/Dawson_Creek" + [93]=> + unicode(14) "America/Denver" + [94]=> + unicode(15) "America/Detroit" + [95]=> + unicode(16) "America/Dominica" + [96]=> + unicode(16) "America/Edmonton" + [97]=> + unicode(16) "America/Eirunepe" + [98]=> + unicode(19) "America/El_Salvador" + [99]=> + unicode(17) "America/Fortaleza" + [100]=> + unicode(17) "America/Glace_Bay" + [101]=> + unicode(15) "America/Godthab" + [102]=> + unicode(17) "America/Goose_Bay" + [103]=> + unicode(18) "America/Grand_Turk" + [104]=> + unicode(15) "America/Grenada" + [105]=> + unicode(18) "America/Guadeloupe" + [106]=> + unicode(17) "America/Guatemala" + [107]=> + unicode(17) "America/Guayaquil" + [108]=> + unicode(14) "America/Guyana" + [109]=> + unicode(15) "America/Halifax" + [110]=> + unicode(14) "America/Havana" + [111]=> + unicode(18) "America/Hermosillo" + [112]=> + unicode(28) "America/Indiana/Indianapolis" + [113]=> + unicode(20) "America/Indiana/Knox" + [114]=> + unicode(23) "America/Indiana/Marengo" + [115]=> + unicode(26) "America/Indiana/Petersburg" + [116]=> + unicode(25) "America/Indiana/Tell_City" + [117]=> + unicode(21) "America/Indiana/Vevay" + [118]=> + unicode(25) "America/Indiana/Vincennes" + [119]=> + unicode(23) "America/Indiana/Winamac" + [120]=> + unicode(14) "America/Inuvik" + [121]=> + unicode(15) "America/Iqaluit" + [122]=> + unicode(15) "America/Jamaica" + [123]=> + unicode(14) "America/Juneau" + [124]=> + unicode(27) "America/Kentucky/Louisville" + [125]=> + unicode(27) "America/Kentucky/Monticello" + [126]=> + unicode(14) "America/La_Paz" + [127]=> + unicode(12) "America/Lima" + [128]=> + unicode(19) "America/Los_Angeles" + [129]=> + unicode(14) "America/Maceio" + [130]=> + unicode(15) "America/Managua" + [131]=> + unicode(14) "America/Manaus" + [132]=> + unicode(15) "America/Marigot" + [133]=> + unicode(18) "America/Martinique" + [134]=> + unicode(16) "America/Mazatlan" + [135]=> + unicode(17) "America/Menominee" + [136]=> + unicode(14) "America/Merida" + [137]=> + unicode(19) "America/Mexico_City" + [138]=> + unicode(16) "America/Miquelon" + [139]=> + unicode(15) "America/Moncton" + [140]=> + unicode(17) "America/Monterrey" + [141]=> + unicode(18) "America/Montevideo" + [142]=> + unicode(16) "America/Montreal" + [143]=> + unicode(18) "America/Montserrat" + [144]=> + unicode(14) "America/Nassau" + [145]=> + unicode(16) "America/New_York" + [146]=> + unicode(15) "America/Nipigon" + [147]=> + unicode(12) "America/Nome" + [148]=> + unicode(15) "America/Noronha" + [149]=> + unicode(27) "America/North_Dakota/Center" + [150]=> + unicode(30) "America/North_Dakota/New_Salem" + [151]=> + unicode(14) "America/Panama" + [152]=> + unicode(19) "America/Pangnirtung" + [153]=> + unicode(18) "America/Paramaribo" + [154]=> + unicode(15) "America/Phoenix" + [155]=> + unicode(22) "America/Port-au-Prince" + [156]=> + unicode(21) "America/Port_of_Spain" + [157]=> + unicode(19) "America/Porto_Velho" + [158]=> + unicode(19) "America/Puerto_Rico" + [159]=> + unicode(19) "America/Rainy_River" + [160]=> + unicode(20) "America/Rankin_Inlet" + [161]=> + unicode(14) "America/Recife" + [162]=> + unicode(14) "America/Regina" + [163]=> + unicode(16) "America/Resolute" + [164]=> + unicode(18) "America/Rio_Branco" + [165]=> + unicode(16) "America/Santarem" + [166]=> + unicode(16) "America/Santiago" + [167]=> + unicode(21) "America/Santo_Domingo" + [168]=> + unicode(17) "America/Sao_Paulo" + [169]=> + unicode(20) "America/Scoresbysund" + [170]=> + unicode(16) "America/Shiprock" + [171]=> + unicode(21) "America/St_Barthelemy" + [172]=> + unicode(16) "America/St_Johns" + [173]=> + unicode(16) "America/St_Kitts" + [174]=> + unicode(16) "America/St_Lucia" + [175]=> + unicode(17) "America/St_Thomas" + [176]=> + unicode(18) "America/St_Vincent" + [177]=> + unicode(21) "America/Swift_Current" + [178]=> + unicode(19) "America/Tegucigalpa" + [179]=> + unicode(13) "America/Thule" + [180]=> + unicode(19) "America/Thunder_Bay" + [181]=> + unicode(15) "America/Tijuana" + [182]=> + unicode(15) "America/Toronto" + [183]=> + unicode(15) "America/Tortola" + [184]=> + unicode(17) "America/Vancouver" + [185]=> + unicode(18) "America/Whitehorse" + [186]=> + unicode(16) "America/Winnipeg" + [187]=> + unicode(15) "America/Yakutat" + [188]=> + unicode(19) "America/Yellowknife" + [189]=> + unicode(16) "Antarctica/Casey" + [190]=> + unicode(16) "Antarctica/Davis" + [191]=> + unicode(25) "Antarctica/DumontDUrville" + [192]=> + unicode(17) "Antarctica/Mawson" + [193]=> + unicode(18) "Antarctica/McMurdo" + [194]=> + unicode(17) "Antarctica/Palmer" + [195]=> + unicode(18) "Antarctica/Rothera" + [196]=> + unicode(21) "Antarctica/South_Pole" + [197]=> + unicode(16) "Antarctica/Syowa" + [198]=> + unicode(17) "Antarctica/Vostok" + [199]=> + unicode(19) "Arctic/Longyearbyen" + [200]=> + unicode(9) "Asia/Aden" + [201]=> + unicode(11) "Asia/Almaty" + [202]=> + unicode(10) "Asia/Amman" + [203]=> + unicode(11) "Asia/Anadyr" + [204]=> + unicode(10) "Asia/Aqtau" + [205]=> + unicode(11) "Asia/Aqtobe" + [206]=> + unicode(13) "Asia/Ashgabat" + [207]=> + unicode(12) "Asia/Baghdad" + [208]=> + unicode(12) "Asia/Bahrain" + [209]=> + unicode(9) "Asia/Baku" + [210]=> + unicode(12) "Asia/Bangkok" + [211]=> + unicode(11) "Asia/Beirut" + [212]=> + unicode(12) "Asia/Bishkek" + [213]=> + unicode(11) "Asia/Brunei" + [214]=> + unicode(15) "Asia/Choibalsan" + [215]=> + unicode(14) "Asia/Chongqing" + [216]=> + unicode(12) "Asia/Colombo" + [217]=> + unicode(13) "Asia/Damascus" + [218]=> + unicode(10) "Asia/Dhaka" + [219]=> + unicode(9) "Asia/Dili" + [220]=> + unicode(10) "Asia/Dubai" + [221]=> + unicode(13) "Asia/Dushanbe" + [222]=> + unicode(9) "Asia/Gaza" + [223]=> + unicode(11) "Asia/Harbin" + [224]=> + unicode(16) "Asia/Ho_Chi_Minh" + [225]=> + unicode(14) "Asia/Hong_Kong" + [226]=> + unicode(9) "Asia/Hovd" + [227]=> + unicode(12) "Asia/Irkutsk" + [228]=> + unicode(12) "Asia/Jakarta" + [229]=> + unicode(13) "Asia/Jayapura" + [230]=> + unicode(14) "Asia/Jerusalem" + [231]=> + unicode(10) "Asia/Kabul" + [232]=> + unicode(14) "Asia/Kamchatka" + [233]=> + unicode(12) "Asia/Karachi" + [234]=> + unicode(12) "Asia/Kashgar" + [235]=> + unicode(14) "Asia/Kathmandu" + [236]=> + unicode(12) "Asia/Kolkata" + [237]=> + unicode(16) "Asia/Krasnoyarsk" + [238]=> + unicode(17) "Asia/Kuala_Lumpur" + [239]=> + unicode(12) "Asia/Kuching" + [240]=> + unicode(11) "Asia/Kuwait" + [241]=> + unicode(10) "Asia/Macau" + [242]=> + unicode(12) "Asia/Magadan" + [243]=> + unicode(13) "Asia/Makassar" + [244]=> + unicode(11) "Asia/Manila" + [245]=> + unicode(11) "Asia/Muscat" + [246]=> + unicode(12) "Asia/Nicosia" + [247]=> + unicode(16) "Asia/Novosibirsk" + [248]=> + unicode(9) "Asia/Omsk" + [249]=> + unicode(9) "Asia/Oral" + [250]=> + unicode(15) "Asia/Phnom_Penh" + [251]=> + unicode(14) "Asia/Pontianak" + [252]=> + unicode(14) "Asia/Pyongyang" + [253]=> + unicode(10) "Asia/Qatar" + [254]=> + unicode(14) "Asia/Qyzylorda" + [255]=> + unicode(12) "Asia/Rangoon" + [256]=> + unicode(11) "Asia/Riyadh" + [257]=> + unicode(13) "Asia/Sakhalin" + [258]=> + unicode(14) "Asia/Samarkand" + [259]=> + unicode(10) "Asia/Seoul" + [260]=> + unicode(13) "Asia/Shanghai" + [261]=> + unicode(14) "Asia/Singapore" + [262]=> + unicode(11) "Asia/Taipei" + [263]=> + unicode(13) "Asia/Tashkent" + [264]=> + unicode(12) "Asia/Tbilisi" + [265]=> + unicode(11) "Asia/Tehran" + [266]=> + unicode(12) "Asia/Thimphu" + [267]=> + unicode(10) "Asia/Tokyo" + [268]=> + unicode(16) "Asia/Ulaanbaatar" + [269]=> + unicode(11) "Asia/Urumqi" + [270]=> + unicode(14) "Asia/Vientiane" + [271]=> + unicode(16) "Asia/Vladivostok" + [272]=> + unicode(12) "Asia/Yakutsk" + [273]=> + unicode(18) "Asia/Yekaterinburg" + [274]=> + unicode(12) "Asia/Yerevan" + [275]=> + unicode(15) "Atlantic/Azores" + [276]=> + unicode(16) "Atlantic/Bermuda" + [277]=> + unicode(15) "Atlantic/Canary" + [278]=> + unicode(19) "Atlantic/Cape_Verde" + [279]=> + unicode(14) "Atlantic/Faroe" + [280]=> + unicode(16) "Atlantic/Madeira" + [281]=> + unicode(18) "Atlantic/Reykjavik" + [282]=> + unicode(22) "Atlantic/South_Georgia" + [283]=> + unicode(18) "Atlantic/St_Helena" + [284]=> + unicode(16) "Atlantic/Stanley" + [285]=> + unicode(18) "Australia/Adelaide" + [286]=> + unicode(18) "Australia/Brisbane" + [287]=> + unicode(21) "Australia/Broken_Hill" + [288]=> + unicode(16) "Australia/Currie" + [289]=> + unicode(16) "Australia/Darwin" + [290]=> + unicode(15) "Australia/Eucla" + [291]=> + unicode(16) "Australia/Hobart" + [292]=> + unicode(18) "Australia/Lindeman" + [293]=> + unicode(19) "Australia/Lord_Howe" + [294]=> + unicode(19) "Australia/Melbourne" + [295]=> + unicode(15) "Australia/Perth" + [296]=> + unicode(16) "Australia/Sydney" + [297]=> + unicode(16) "Europe/Amsterdam" + [298]=> + unicode(14) "Europe/Andorra" + [299]=> + unicode(13) "Europe/Athens" + [300]=> + unicode(15) "Europe/Belgrade" + [301]=> + unicode(13) "Europe/Berlin" + [302]=> + unicode(17) "Europe/Bratislava" + [303]=> + unicode(15) "Europe/Brussels" + [304]=> + unicode(16) "Europe/Bucharest" + [305]=> + unicode(15) "Europe/Budapest" + [306]=> + unicode(15) "Europe/Chisinau" + [307]=> + unicode(17) "Europe/Copenhagen" + [308]=> + unicode(13) "Europe/Dublin" + [309]=> + unicode(16) "Europe/Gibraltar" + [310]=> + unicode(15) "Europe/Guernsey" + [311]=> + unicode(15) "Europe/Helsinki" + [312]=> + unicode(18) "Europe/Isle_of_Man" + [313]=> + unicode(15) "Europe/Istanbul" + [314]=> + unicode(13) "Europe/Jersey" + [315]=> + unicode(18) "Europe/Kaliningrad" + [316]=> + unicode(11) "Europe/Kiev" + [317]=> + unicode(13) "Europe/Lisbon" + [318]=> + unicode(16) "Europe/Ljubljana" + [319]=> + unicode(13) "Europe/London" + [320]=> + unicode(17) "Europe/Luxembourg" + [321]=> + unicode(13) "Europe/Madrid" + [322]=> + unicode(12) "Europe/Malta" + [323]=> + unicode(16) "Europe/Mariehamn" + [324]=> + unicode(12) "Europe/Minsk" + [325]=> + unicode(13) "Europe/Monaco" + [326]=> + unicode(13) "Europe/Moscow" + [327]=> + unicode(11) "Europe/Oslo" + [328]=> + unicode(12) "Europe/Paris" + [329]=> + unicode(16) "Europe/Podgorica" + [330]=> + unicode(13) "Europe/Prague" + [331]=> + unicode(11) "Europe/Riga" + [332]=> + unicode(11) "Europe/Rome" + [333]=> + unicode(13) "Europe/Samara" + [334]=> + unicode(17) "Europe/San_Marino" + [335]=> + unicode(15) "Europe/Sarajevo" + [336]=> + unicode(17) "Europe/Simferopol" + [337]=> + unicode(13) "Europe/Skopje" + [338]=> + unicode(12) "Europe/Sofia" + [339]=> + unicode(16) "Europe/Stockholm" + [340]=> + unicode(14) "Europe/Tallinn" + [341]=> + unicode(13) "Europe/Tirane" + [342]=> + unicode(15) "Europe/Uzhgorod" + [343]=> + unicode(12) "Europe/Vaduz" + [344]=> + unicode(14) "Europe/Vatican" + [345]=> + unicode(13) "Europe/Vienna" + [346]=> + unicode(14) "Europe/Vilnius" + [347]=> + unicode(16) "Europe/Volgograd" + [348]=> + unicode(13) "Europe/Warsaw" + [349]=> + unicode(13) "Europe/Zagreb" + [350]=> + unicode(17) "Europe/Zaporozhye" + [351]=> + unicode(13) "Europe/Zurich" + [352]=> + unicode(19) "Indian/Antananarivo" + [353]=> + unicode(13) "Indian/Chagos" + [354]=> + unicode(16) "Indian/Christmas" + [355]=> + unicode(12) "Indian/Cocos" + [356]=> + unicode(13) "Indian/Comoro" + [357]=> + unicode(16) "Indian/Kerguelen" + [358]=> + unicode(11) "Indian/Mahe" + [359]=> + unicode(15) "Indian/Maldives" + [360]=> + unicode(16) "Indian/Mauritius" + [361]=> + unicode(14) "Indian/Mayotte" + [362]=> + unicode(14) "Indian/Reunion" + [363]=> + unicode(12) "Pacific/Apia" + [364]=> + unicode(16) "Pacific/Auckland" + [365]=> + unicode(15) "Pacific/Chatham" + [366]=> + unicode(14) "Pacific/Easter" + [367]=> + unicode(13) "Pacific/Efate" + [368]=> + unicode(17) "Pacific/Enderbury" + [369]=> + unicode(15) "Pacific/Fakaofo" + [370]=> + unicode(12) "Pacific/Fiji" + [371]=> + unicode(16) "Pacific/Funafuti" + [372]=> + unicode(17) "Pacific/Galapagos" + [373]=> + unicode(15) "Pacific/Gambier" + [374]=> + unicode(19) "Pacific/Guadalcanal" + [375]=> + unicode(12) "Pacific/Guam" + [376]=> + unicode(16) "Pacific/Honolulu" + [377]=> + unicode(16) "Pacific/Johnston" + [378]=> + unicode(18) "Pacific/Kiritimati" + [379]=> + unicode(14) "Pacific/Kosrae" + [380]=> + unicode(17) "Pacific/Kwajalein" + [381]=> + unicode(14) "Pacific/Majuro" + [382]=> + unicode(17) "Pacific/Marquesas" + [383]=> + unicode(14) "Pacific/Midway" + [384]=> + unicode(13) "Pacific/Nauru" + [385]=> + unicode(12) "Pacific/Niue" + [386]=> + unicode(15) "Pacific/Norfolk" + [387]=> + unicode(14) "Pacific/Noumea" + [388]=> + unicode(17) "Pacific/Pago_Pago" + [389]=> + unicode(13) "Pacific/Palau" + [390]=> + unicode(16) "Pacific/Pitcairn" + [391]=> + unicode(14) "Pacific/Ponape" + [392]=> + unicode(20) "Pacific/Port_Moresby" + [393]=> + unicode(17) "Pacific/Rarotonga" + [394]=> + unicode(14) "Pacific/Saipan" + [395]=> + unicode(14) "Pacific/Tahiti" + [396]=> + unicode(14) "Pacific/Tarawa" + [397]=> + unicode(17) "Pacific/Tongatapu" + [398]=> + unicode(12) "Pacific/Truk" + [399]=> + unicode(12) "Pacific/Wake" + [400]=> + unicode(14) "Pacific/Wallis" + [401]=> + unicode(3) "UTC" +} +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_serialize.phpt b/ext/date/tests/DateTimeZone_serialize.phpt new file mode 100644 index 0000000000..7d0545de5e --- /dev/null +++ b/ext/date/tests/DateTimeZone_serialize.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test serialization of DateTimeZone objects +--FILE-- +getName() ); + +?> +===DONE=== +--EXPECTF-- +object(DateTimeZone)#%d (0) { +} +unicode(24) "O:12:"DateTimeZone":0:{}" +object(DateTimeZone)#%d (0) { +} + +Warning: DateTimeZone::getName(): The DateTimeZone object has not been correctly initialized by its constructor in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/date/tests/DateTimeZone_verify.phpt b/ext/date/tests/DateTimeZone_verify.phpt new file mode 100644 index 0000000000..4af792324b --- /dev/null +++ b/ext/date/tests/DateTimeZone_verify.phpt @@ -0,0 +1,111 @@ +--TEST-- +Test DateTimeZone class registration +--FILE-- +getMethods(); +var_dump($methods); + +echo "..and get names of all its class constants\n"; +$constants = $class->getConstants(); +var_dump($constants); +?> +===DONE=== +--EXPECTF-- +*** Verify DateTimeZone class *** +Verify DateTimeZone class registered OK +object(ReflectionClass)#%d (1) { + [u"name"]=> + unicode(12) "DateTimeZone" +} +..and get names of all its methods +array(7) { + [0]=> + &object(ReflectionMethod)#%d (2) { + [u"name"]=> + unicode(11) "__construct" + [u"class"]=> + unicode(12) "DateTimeZone" + } + [1]=> + &object(ReflectionMethod)#%d (2) { + [u"name"]=> + unicode(7) "getName" + [u"class"]=> + unicode(12) "DateTimeZone" + } + [2]=> + &object(ReflectionMethod)#%d (2) { + [u"name"]=> + unicode(9) "getOffset" + [u"class"]=> + unicode(12) "DateTimeZone" + } + [3]=> + &object(ReflectionMethod)#%d (2) { + [u"name"]=> + unicode(14) "getTransitions" + [u"class"]=> + unicode(12) "DateTimeZone" + } + [4]=> + &object(ReflectionMethod)#%d (2) { + [u"name"]=> + unicode(11) "getLocation" + [u"class"]=> + unicode(12) "DateTimeZone" + } + [5]=> + &object(ReflectionMethod)#%d (2) { + [u"name"]=> + unicode(17) "listAbbreviations" + [u"class"]=> + unicode(12) "DateTimeZone" + } + [6]=> + &object(ReflectionMethod)#%d (2) { + [u"name"]=> + unicode(15) "listIdentifiers" + [u"class"]=> + unicode(12) "DateTimeZone" + } +} +..and get names of all its class constants +array(14) { + [u"AFRICA"]=> + int(1) + [u"AMERICA"]=> + int(2) + [u"ANTARCTICA"]=> + int(4) + [u"ARCTIC"]=> + int(8) + [u"ASIA"]=> + int(16) + [u"ATLANTIC"]=> + int(32) + [u"AUSTRALIA"]=> + int(64) + [u"EUROPE"]=> + int(128) + [u"INDIAN"]=> + int(256) + [u"PACIFIC"]=> + int(512) + [u"UTC"]=> + int(1024) + [u"ALL"]=> + int(2047) + [u"ALL_WITH_BC"]=> + int(4095) + [u"PER_COUNTRY"]=> + int(4096) +} +===DONE=== \ No newline at end of file