Annotation of embedaddon/php/ext/date/tests/bug33414-2.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #33414 [2] (Comprehensive list of incorrect days returned after strotime() / date() tests)
        !             3: --FILE--
        !             4: <?php
        !             5: print "TZ=Pacific/Rarotonga - wrong day.\n";
        !             6: date_default_timezone_set("Pacific/Rarotonga");
        !             7: $tStamp = mktime (17, 17, 17, 1, 1, 1970);       
        !             8: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !             9: $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
        !            10: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            11: print "wanted=Tuesday            00:00:00\n\n"; 
        !            12: 
        !            13: print "TZ=Atlantic/South_Georgia - wrong day.\n";
        !            14: date_default_timezone_set("Atlantic/South_Georgia");
        !            15: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
        !            16: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !            17: $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
        !            18: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            19: print "wanted=Tuesday            00:00:00\n\n";
        !            20: 
        !            21: print "TZ=America/Port-au-Prince - wrong day.\n";
        !            22: date_default_timezone_set("America/Port-au-Prince");
        !            23: $tStamp = mktime (17, 17, 17, 1, 12871, 1970);
        !            24: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !            25: $strtotime_tstamp = strtotime("next Monday", $tStamp);
        !            26: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            27: print "wanted=Monday            00:00:00\n\n";
        !            28: 
        !            29: print "TZ=Pacific/Enderbury - wrong day, off by 2 days.\n";
        !            30: date_default_timezone_set("Pacific/Enderbury");
        !            31: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
        !            32: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !            33: $strtotime_tstamp = strtotime("next Monday", $tStamp);
        !            34: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            35: print "wanted=Monday            00:00:00\n\n";
        !            36: 
        !            37: print "TZ=Pacific/Kiritimati - wrong day, off by 2 days.\n";
        !            38: date_default_timezone_set("Pacific/Kiritimati");
        !            39: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
        !            40: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !            41: $strtotime_tstamp = strtotime("next Monday", $tStamp);                 
        !            42: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            43: print "wanted=Monday            00:00:00\n\n";
        !            44: 
        !            45: print "TZ=America/Managua - wrong day.\n";     
        !            46: date_default_timezone_set("America/Managua");
        !            47: $tStamp = mktime (17, 17, 17, 1, 12879, 1970);
        !            48: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !            49: $strtotime_tstamp = strtotime("next Tuesday", $tStamp);
        !            50: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            51: print "wanted=Tuesday            00:00:00\n\n";     
        !            52: 
        !            53: print "TZ=Pacific/Pitcairn - wrong day.\n";
        !            54: date_default_timezone_set("Pacific/Pitcairn");
        !            55: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
        !            56: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !            57: $strtotime_tstamp = strtotime("next Wednesday", $tStamp);
        !            58: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            59: print "wanted=Wednesday            00:00:00\n\n";
        !            60: 
        !            61: print "TZ=Pacific/Fakaofo - wrong day.\n";
        !            62: date_default_timezone_set("Pacific/Fakaofo");
        !            63: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
        !            64: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !            65: $strtotime_tstamp = strtotime("next Saturday", $tStamp);
        !            66: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            67: print "wanted=Saturday            00:00:00\n\n";
        !            68: 
        !            69: print "TZ=Pacific/Johnston - wrong day.\n";
        !            70: date_default_timezone_set("Pacific/Johnston");
        !            71: $tStamp = mktime (17, 17, 17, 1, 1, 1970);
        !            72: print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
        !            73: $strtotime_tstamp = strtotime("next Friday", $tStamp);
        !            74: print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
        !            75: print "wanted=Friday            00:00:00\n\n";
        !            76: ?>
        !            77: --EXPECT--
        !            78: TZ=Pacific/Rarotonga - wrong day.
        !            79: tStamp=Thursday 1970-01-01 17:17:17 CKT 0
        !            80: result=Tuesday 1970-01-06 00:00:00 CKT 0
        !            81: wanted=Tuesday            00:00:00
        !            82: 
        !            83: TZ=Atlantic/South_Georgia - wrong day.
        !            84: tStamp=Thursday 1970-01-01 17:17:17 GST 0
        !            85: result=Tuesday 1970-01-06 00:00:00 GST 0
        !            86: wanted=Tuesday            00:00:00
        !            87: 
        !            88: TZ=America/Port-au-Prince - wrong day.
        !            89: tStamp=Monday 2005-03-28 17:17:17 EST 0
        !            90: result=Monday 2005-04-04 00:00:00 EDT 1
        !            91: wanted=Monday            00:00:00
        !            92: 
        !            93: TZ=Pacific/Enderbury - wrong day, off by 2 days.
        !            94: tStamp=Thursday 1970-01-01 17:17:17 PHOT 0
        !            95: result=Monday 1970-01-05 00:00:00 PHOT 0
        !            96: wanted=Monday            00:00:00
        !            97: 
        !            98: TZ=Pacific/Kiritimati - wrong day, off by 2 days.
        !            99: tStamp=Thursday 1970-01-01 17:17:17 LINT 0
        !           100: result=Monday 1970-01-05 00:00:00 LINT 0
        !           101: wanted=Monday            00:00:00
        !           102: 
        !           103: TZ=America/Managua - wrong day.
        !           104: tStamp=Tuesday 2005-04-05 17:17:17 CST 0
        !           105: result=Tuesday 2005-04-12 00:00:00 CDT 1
        !           106: wanted=Tuesday            00:00:00
        !           107: 
        !           108: TZ=Pacific/Pitcairn - wrong day.
        !           109: tStamp=Thursday 1970-01-01 17:17:17 PNT 0
        !           110: result=Wednesday 1970-01-07 00:00:00 PNT 0
        !           111: wanted=Wednesday            00:00:00
        !           112: 
        !           113: TZ=Pacific/Fakaofo - wrong day.
        !           114: tStamp=Thursday 1970-01-01 17:17:17 TKT 0
        !           115: result=Saturday 1970-01-03 00:00:00 TKT 0
        !           116: wanted=Saturday            00:00:00
        !           117: 
        !           118: TZ=Pacific/Johnston - wrong day.
        !           119: tStamp=Thursday 1970-01-01 17:17:17 HST 0
        !           120: result=Friday 1970-01-02 00:00:00 HST 0
        !           121: wanted=Friday            00:00:00

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>