Annotation of embedaddon/php/ext/date/tests/DateTime_data-dates.inc, revision 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: * Particular days
! 13: */
! 14: echo "test__7: ";
! 15: examine_diff('2009-01-14', '2009-01-07', 'P+0Y0M7DT0H0M0S', 7);
! 16:
! 17: echo "test_years_positive__7_by_0_day: ";
! 18: examine_diff('2007-02-07', '2000-02-07', 'P+7Y0M0DT0H0M0S', 2557);
! 19:
! 20: echo "test_years_positive__7_by_1_day: ";
! 21: examine_diff('2007-02-08', '2000-02-07', 'P+7Y0M1DT0H0M0S', 2558);
! 22:
! 23: // NOTE: sub() produces different answer.
! 24: echo "test_years_positive__6_shy_1_day: ";
! 25: examine_diff('2007-02-06', '2000-02-07', 'P+6Y11M30DT0H0M0S', 2556);
! 26:
! 27: echo "test_years_positive__7_by_1_month: ";
! 28: examine_diff('2007-03-07', '2000-02-07', 'P+7Y1M0DT0H0M0S', 2585);
! 29:
! 30: echo "test_years_positive__6_shy_1_month: ";
! 31: examine_diff('2007-01-07', '2000-02-07', 'P+6Y11M0DT0H0M0S', 2526);
! 32:
! 33: echo "test_years_positive__7_by_1_month_split_newyear: ";
! 34: examine_diff('2007-01-07', '1999-12-07', 'P+7Y1M0DT0H0M0S', 2588);
! 35:
! 36: echo "test_years_positive__6_shy_1_month_split_newyear: ";
! 37: examine_diff('2006-12-07', '2000-01-07', 'P+6Y11M0DT0H0M0S', 2526);
! 38:
! 39:
! 40: /*
! 41: * Particular days, negative
! 42: */
! 43: echo "test_negative__7: ";
! 44: examine_diff('2009-01-07', '2009-01-14', 'P-0Y0M7DT0H0M0S', 7);
! 45:
! 46: echo "test_years_negative__7_by_0_day: ";
! 47: examine_diff('2000-02-07', '2007-02-07', 'P-7Y0M0DT0H0M0S', 2557);
! 48:
! 49: echo "test_years_negative__7_by_1_day: ";
! 50: examine_diff('2000-02-07', '2007-02-08', 'P-7Y0M1DT0H0M0S', 2558);
! 51:
! 52: // NOTE: sub() produces different answer.
! 53: echo "test_years_negative__6_shy_1_day: ";
! 54: examine_diff('2000-02-07', '2007-02-06', 'P-6Y11M28DT0H0M0S', 2556);
! 55:
! 56: echo "test_years_negative__7_by_1_month: ";
! 57: examine_diff('2000-02-07', '2007-03-07', 'P-7Y1M0DT0H0M0S', 2585);
! 58:
! 59: echo "test_years_negative__6_shy_1_month: ";
! 60: examine_diff('2000-02-07', '2007-01-07', 'P-6Y11M0DT0H0M0S', 2526);
! 61:
! 62: echo "test_years_negative__7_by_1_month_split_newyear: ";
! 63: examine_diff('1999-12-07', '2007-01-07', 'P-7Y1M0DT0H0M0S', 2588);
! 64:
! 65: echo "test_years_negative__6_shy_1_month_split_newyear: ";
! 66: examine_diff('2000-01-07', '2006-12-07', 'P-6Y11M0DT0H0M0S', 2526);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>