Advertisement
Sk8erPeter

PHP: Test cases for getting timestamp one month later to now

May 31st, 2012
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. // Test cases for http://stackoverflow.com/questions/10834350/php-date-functions-results-related-to-the-next-month-are-not-correct-php-bugs
  2. // http://i.imgur.com/KwlJq.png
  3.  
  4. [1]. Timestamp to test ($timestamp_to_test) (string):
  5. '2012-06-01 03:31:48'
  6.  
  7. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  8. '2012-07-01 03:31:48'
  9.  
  10. [2]. Timestamp to test ($timestamp_to_test) (string):
  11. '2011-01-28 23:59:59'
  12.  
  13. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  14. '2011-02-28 23:59:59'
  15.  
  16. [3]. Timestamp to test ($timestamp_to_test) (string):
  17. '2011-01-29 23:59:59'
  18.  
  19. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  20. '2011-02-28 23:59:59'
  21.  
  22. [4]. Timestamp to test ($timestamp_to_test) (string):
  23. '2011-01-30 23:59:59'
  24.  
  25. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  26. '2011-02-28 23:59:59'
  27.  
  28. [5]. Timestamp to test ($timestamp_to_test) (string):
  29. '2011-01-31 23:59:59'
  30.  
  31. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  32. '2011-02-28 23:59:59'
  33.  
  34. [6]. Timestamp to test ($timestamp_to_test) (string):
  35. '2012-01-28 23:59:59'
  36.  
  37. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  38. '2012-02-28 23:59:59'
  39.  
  40. [7]. Timestamp to test ($timestamp_to_test) (string):
  41. '2012-01-29 23:59:59'
  42.  
  43. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  44. '2012-02-29 23:59:59'
  45.  
  46. [8]. Timestamp to test ($timestamp_to_test) (string):
  47. '2012-01-30 23:59:59'
  48.  
  49. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  50. '2012-02-29 23:59:59'
  51.  
  52. [9]. Timestamp to test ($timestamp_to_test) (string):
  53. '2012-01-31 23:59:59'
  54.  
  55. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  56. '2012-02-29 23:59:59'
  57.  
  58. [10]. Timestamp to test ($timestamp_to_test) (string):
  59. '2012-02-29 23:59:59'
  60.  
  61. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  62. '2012-03-29 23:59:59'
  63.  
  64. [11]. Timestamp to test ($timestamp_to_test) (string):
  65. '2012-03-30 23:59:59'
  66.  
  67. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  68. '2012-04-30 23:59:59'
  69.  
  70. [12]. Timestamp to test ($timestamp_to_test) (string):
  71. '2012-03-31 23:59:59'
  72.  
  73. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  74. '2012-04-30 23:59:59'
  75.  
  76. [13]. Timestamp to test ($timestamp_to_test) (string):
  77. '2012-04-30 23:59:59'
  78.  
  79. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  80. '2012-05-30 23:59:59'
  81.  
  82. [14]. Timestamp to test ($timestamp_to_test) (string):
  83. '2012-05-31 23:59:59'
  84.  
  85. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  86. '2012-06-30 23:59:59'
  87.  
  88. [15]. Timestamp to test ($timestamp_to_test) (string):
  89. '2012-12-31 23:59:59'
  90.  
  91. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  92. '2013-01-31 23:59:59'
  93.  
  94. [16]. Timestamp to test ($timestamp_to_test) (string):
  95. '2013-01-31 23:59:59'
  96.  
  97. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  98. '2013-02-28 23:59:59'
  99.  
  100. [17]. Timestamp to test ($timestamp_to_test) (string):
  101. '2013-02-28 23:59:59'
  102.  
  103. Timestamp + 1 month (getOneMonthLaterTimestamp($timestamp_to_test)) (string):
  104. '2013-03-28 23:59:59'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement