Annotation of embedaddon/php/ext/date/tests/DateTime_data-february.inc, revision 1.1.1.1

1.1       misho       1: <?php
                      2: 
                      3: /*
                      4:  * Note: test names match method names in a set of PHPUnit tests
                      5:  * in a userland package.  Please be so kind as to leave them.
                      6:  */
                      7: 
                      8: date_default_timezone_set('America/New_York');
                      9: 
                     10: 
                     11: /*
                     12:  * Check PHP bug 49081
                     13:  */
                     14: echo "test_bug_49081__1: ";
                     15: examine_diff('2010-03-31', '2010-03-01', 'P+0Y0M30DT0H0M0S', 30);
                     16: 
                     17: echo "test_bug_49081__2: ";
                     18: examine_diff('2010-04-01', '2010-03-01', 'P+0Y1M0DT0H0M0S', 31);
                     19: 
                     20: echo "test_bug_49081__3: ";
                     21: examine_diff('2010-04-01', '2010-03-31', 'P+0Y0M1DT0H0M0S', 1);
                     22: 
                     23: echo "test_bug_49081__4: ";
                     24: examine_diff('2010-04-29', '2010-03-31', 'P+0Y0M29DT0H0M0S', 29);
                     25: 
                     26: echo "test_bug_49081__5: ";
                     27: examine_diff('2010-04-30', '2010-03-31', 'P+0Y0M30DT0H0M0S', 30);
                     28: 
                     29: echo "test_bug_49081__6: ";
                     30: examine_diff('2010-04-30', '2010-03-30', 'P+0Y1M0DT0H0M0S', 31);
                     31: 
                     32: echo "test_bug_49081__7: ";
                     33: examine_diff('2010-04-30', '2010-03-29', 'P+0Y1M1DT0H0M0S', 32);
                     34: 
                     35: echo "test_bug_49081__8: ";
                     36: examine_diff('2010-01-29', '2010-01-01', 'P+0Y0M28DT0H0M0S', 28);
                     37: 
                     38: echo "test_bug_49081__9: ";
                     39: examine_diff('2010-01-30', '2010-01-01', 'P+0Y0M29DT0H0M0S', 29);
                     40: 
                     41: echo "test_bug_49081__10: ";
                     42: examine_diff('2010-01-31', '2010-01-01', 'P+0Y0M30DT0H0M0S', 30);
                     43: 
                     44: echo "test_bug_49081__11: ";
                     45: examine_diff('2010-02-01', '2010-01-01', 'P+0Y1M0DT0H0M0S', 31);
                     46: 
                     47: echo "test_bug_49081__12: ";
                     48: examine_diff('2010-02-01', '2010-01-31', 'P+0Y0M1DT0H0M0S', 1);
                     49: 
                     50: echo "test_bug_49081__13: ";
                     51: examine_diff('2010-02-27', '2010-01-31', 'P+0Y0M27DT0H0M0S', 27);
                     52: 
                     53: echo "test_bug_49081__14: ";
                     54: examine_diff('2010-02-28', '2010-01-31', 'P+0Y0M28DT0H0M0S', 28);
                     55: 
                     56: echo "test_bug_49081__15: ";
                     57: examine_diff('2010-02-28', '2010-01-30', 'P+0Y0M29DT0H0M0S', 29);
                     58: 
                     59: echo "test_bug_49081__16: ";
                     60: examine_diff('2010-02-28', '2010-01-29', 'P+0Y0M30DT0H0M0S', 30);
                     61: 
                     62: echo "test_bug_49081__17: ";
                     63: examine_diff('2010-02-28', '2010-01-28', 'P+0Y1M0DT0H0M0S', 31);
                     64: 
                     65: echo "test_bug_49081__18: ";
                     66: examine_diff('2010-02-28', '2010-01-27', 'P+0Y1M1DT0H0M0S', 32);
                     67: 
                     68: echo "test_bug_49081__19: ";
                     69: examine_diff('2010-03-01', '2010-01-01', 'P+0Y2M0DT0H0M0S', 59);
                     70: 
                     71: echo "test_bug_49081__20: ";
                     72: examine_diff('2010-03-01', '2010-01-31', 'P+0Y0M29DT0H0M0S', 29);
                     73: 
                     74: // NOTE: sub() produces different answer.
                     75: echo "test_bug_49081__21: ";
                     76: examine_diff('2010-03-27', '2010-01-31', 'P+0Y1M24DT0H0M0S', 55);
                     77: 
                     78: // NOTE: sub() produces different answer.
                     79: echo "test_bug_49081__22: ";
                     80: examine_diff('2010-03-28', '2010-01-31', 'P+0Y1M25DT0H0M0S', 56);
                     81: 
                     82: // NOTE: sub() produces different answer.
                     83: echo "test_bug_49081__23: ";
                     84: examine_diff('2010-03-29', '2010-01-31', 'P+0Y1M26DT0H0M0S', 57);
                     85: 
                     86: // NOTE: sub() produces different answer.
                     87: echo "test_bug_49081__24: ";
                     88: examine_diff('2010-03-30', '2010-01-31', 'P+0Y1M27DT0H0M0S', 58);
                     89: 
                     90: echo "test_bug_49081__25: ";
                     91: examine_diff('2010-03-31', '2010-01-31', 'P+0Y2M0DT0H0M0S', 59);
                     92: 
                     93: echo "test_bug_49081__26: ";
                     94: examine_diff('2010-03-31', '2010-01-30', 'P+0Y2M1DT0H0M0S', 60);
                     95: 
                     96: echo "test_bug_49081__27: ";
                     97: examine_diff('2009-01-31', '2009-01-01', 'P+0Y0M30DT0H0M0S', 30);
                     98: 
                     99: echo "test_bug_49081__28: ";
                    100: examine_diff('2010-03-27', '2010-02-28', 'P+0Y0M27DT0H0M0S', 27);
                    101: 
                    102: echo "test_bug_49081__29: ";
                    103: examine_diff('2010-03-28', '2010-02-28', 'P+0Y1M0DT0H0M0S', 28);
                    104: 
                    105: echo "test_bug_49081__30: ";
                    106: examine_diff('2010-03-29', '2010-02-28', 'P+0Y1M1DT0H0M0S', 29);
                    107: 
                    108: echo "test_bug_49081__31: ";
                    109: examine_diff('2010-03-27', '2010-02-27', 'P+0Y1M0DT0H0M0S', 28);
                    110: 
                    111: echo "test_bug_49081__32: ";
                    112: examine_diff('2010-03-27', '2010-02-26', 'P+0Y1M1DT0H0M0S', 29);
                    113: 
                    114: 
                    115: /*
                    116:  * Check PHP bug 49081, negative
                    117:  */
                    118: echo "test_bug_49081_negative__1: ";
                    119: examine_diff('2010-03-01', '2010-03-31', 'P-0Y0M30DT0H0M0S', 30);
                    120: 
                    121: echo "test_bug_49081_negative__2: ";
                    122: examine_diff('2010-03-01', '2010-04-01', 'P-0Y1M0DT0H0M0S', 31);
                    123: 
                    124: echo "test_bug_49081_negative__3: ";
                    125: examine_diff('2010-03-31', '2010-04-01', 'P-0Y0M1DT0H0M0S', 1);
                    126: 
                    127: echo "test_bug_49081_negative__4: ";
                    128: examine_diff('2010-03-31', '2010-04-29', 'P-0Y0M29DT0H0M0S', 29);
                    129: 
                    130: echo "test_bug_49081_negative__5: ";
                    131: examine_diff('2010-03-31', '2010-04-30', 'P-0Y0M30DT0H0M0S', 30);
                    132: 
                    133: echo "test_bug_49081_negative__6: ";
                    134: examine_diff('2010-03-30', '2010-04-30', 'P-0Y1M0DT0H0M0S', 31);
                    135: 
                    136: echo "test_bug_49081_negative__7: ";
                    137: examine_diff('2010-03-29', '2010-04-30', 'P-0Y1M1DT0H0M0S', 32);
                    138: 
                    139: echo "test_bug_49081_negative__8: ";
                    140: examine_diff('2010-01-01', '2010-01-29', 'P-0Y0M28DT0H0M0S', 28);
                    141: 
                    142: echo "test_bug_49081_negative__9: ";
                    143: examine_diff('2010-01-01', '2010-01-30', 'P-0Y0M29DT0H0M0S', 29);
                    144: 
                    145: echo "test_bug_49081_negative__10: ";
                    146: examine_diff('2010-01-01', '2010-01-31', 'P-0Y0M30DT0H0M0S', 30);
                    147: 
                    148: echo "test_bug_49081_negative__11: ";
                    149: examine_diff('2010-01-01', '2010-02-01', 'P-0Y1M0DT0H0M0S', 31);
                    150: 
                    151: echo "test_bug_49081_negative__12: ";
                    152: examine_diff('2010-01-31', '2010-02-01', 'P-0Y0M1DT0H0M0S', 1);
                    153: 
                    154: echo "test_bug_49081_negative__13: ";
                    155: examine_diff('2010-01-31', '2010-02-27', 'P-0Y0M27DT0H0M0S', 27);
                    156: 
                    157: echo "test_bug_49081_negative__14: ";
                    158: examine_diff('2010-01-31', '2010-02-28', 'P-0Y0M28DT0H0M0S', 28);
                    159: 
                    160: echo "test_bug_49081_negative__15: ";
                    161: examine_diff('2010-01-30', '2010-02-28', 'P-0Y0M29DT0H0M0S', 29);
                    162: 
                    163: echo "test_bug_49081_negative__16: ";
                    164: examine_diff('2010-01-29', '2010-02-28', 'P-0Y0M30DT0H0M0S', 30);
                    165: 
                    166: echo "test_bug_49081_negative__17: ";
                    167: examine_diff('2010-01-28', '2010-02-28', 'P-0Y1M0DT0H0M0S', 31);
                    168: 
                    169: echo "test_bug_49081_negative__18: ";
                    170: examine_diff('2010-01-27', '2010-02-28', 'P-0Y1M1DT0H0M0S', 32);
                    171: 
                    172: echo "test_bug_49081_negative__19: ";
                    173: examine_diff('2010-01-01', '2010-03-01', 'P-0Y2M0DT0H0M0S', 59);
                    174: 
                    175: // NOTE: sub() produces different answer.
                    176: echo "test_bug_49081_negative__20: ";
                    177: examine_diff('2010-01-31', '2010-03-01', 'P-0Y1M1DT0H0M0S', 29);
                    178: 
                    179: // NOTE: sub() produces different answer.
                    180: echo "test_bug_49081_negative__21: ";
                    181: examine_diff('2010-01-31', '2010-03-27', 'P-0Y1M27DT0H0M0S', 55);
                    182: 
                    183: // NOTE: sub() produces different answer.
                    184: echo "test_bug_49081_negative__22: ";
                    185: examine_diff('2010-01-31', '2010-03-28', 'P-0Y1M28DT0H0M0S', 56);
                    186: 
                    187: // NOTE: sub() produces different answer.
                    188: echo "test_bug_49081_negative__23: ";
                    189: examine_diff('2010-01-31', '2010-03-29', 'P-0Y1M29DT0H0M0S', 57);
                    190: 
                    191: // NOTE: sub() produces different answer.
                    192: echo "test_bug_49081_negative__24: ";
                    193: examine_diff('2010-01-31', '2010-03-30', 'P-0Y1M30DT0H0M0S', 58);
                    194: 
                    195: echo "test_bug_49081_negative__25: ";
                    196: examine_diff('2010-01-31', '2010-03-31', 'P-0Y2M0DT0H0M0S', 59);
                    197: 
                    198: echo "test_bug_49081_negative__26: ";
                    199: examine_diff('2010-01-30', '2010-03-31', 'P-0Y2M1DT0H0M0S', 60);
                    200: 
                    201: echo "test_bug_49081_negative__27: ";
                    202: examine_diff('2009-01-01', '2009-01-31', 'P-0Y0M30DT0H0M0S', 30);
                    203: 
                    204: echo "test_bug_49081_negative__28: ";
                    205: examine_diff('2010-02-28', '2010-03-27', 'P-0Y0M27DT0H0M0S', 27);
                    206: 
                    207: echo "test_bug_49081_negative__29: ";
                    208: examine_diff('2010-02-28', '2010-03-28', 'P-0Y1M0DT0H0M0S', 28);
                    209: 
                    210: echo "test_bug_49081_negative__30: ";
                    211: examine_diff('2010-02-28', '2010-03-29', 'P-0Y1M1DT0H0M0S', 29);
                    212: 
                    213: echo "test_bug_49081_negative__31: ";
                    214: examine_diff('2010-02-27', '2010-03-27', 'P-0Y1M0DT0H0M0S', 28);
                    215: 
                    216: echo "test_bug_49081_negative__32: ";
                    217: examine_diff('2010-02-26', '2010-03-27', 'P-0Y1M1DT0H0M0S', 29);

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