You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/Unit/Enums/PresetDateRangesTest.php
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,8 @@ public function it_can_generate_correct_previous_start_date(): void
23
23
$this->assertEquals('2024-06-25 00:00:00', PresetDateRanges::LAST_7_DAYS->getPreviousDateRange()->getDateFrom(), 'Incorrect previous start of LAST_7_DAYS');
24
24
$this->assertEquals('2024-06-11 00:00:00', PresetDateRanges::LAST_14_DAYS->getPreviousDateRange()->getDateFrom(), 'Incorrect previous start of LAST_14_DAYS');
25
25
$this->assertEquals('2024-05-10 00:00:00', PresetDateRanges::LAST_30_DAYS->getPreviousDateRange()->getDateFrom(), 'Incorrect previous start of LAST_30_DAYS');
26
+
$this->assertEquals('2015-01-01 00:00:00', PresetDateRanges::LAST_5_YEARS->getPreviousDateRange()->getDateFrom(), 'Incorrect previous start of LAST_5_YEARS');
27
+
$this->assertEquals('2005-01-01 00:00:00', PresetDateRanges::LAST_10_YEARS->getPreviousDateRange()->getDateFrom(), 'Incorrect previous start of LAST_10_YEARS');
26
28
$this->assertEquals('2015-01-01 00:00:00', PresetDateRanges::LIFETIME->getPreviousDateRange()->getDateFrom(), 'Incorrect previous start of LIFETIME');
27
29
}
28
30
@@ -42,6 +44,8 @@ public function it_can_generate_correct_previous_end_date(): void
42
44
$this->assertEquals('2024-07-01 23:59:59', PresetDateRanges::LAST_7_DAYS->getPreviousDateRange()->getDateTo(), 'Incorrect previous end of LAST_7_DAYS');
43
45
$this->assertEquals('2024-06-24 23:59:59', PresetDateRanges::LAST_14_DAYS->getPreviousDateRange()->getDateTo(), 'Incorrect previous end of LAST_14_DAYS');
44
46
$this->assertEquals('2024-06-08 23:59:59', PresetDateRanges::LAST_30_DAYS->getPreviousDateRange()->getDateTo(), 'Incorrect previous end of LAST_30_DAYS');
47
+
$this->assertEquals('2019-12-31 23:59:59', PresetDateRanges::LAST_5_YEARS->getPreviousDateRange()->getDateTo(), 'Incorrect previous end of LAST_5_YEARS');
48
+
$this->assertEquals('2014-12-31 23:59:59', PresetDateRanges::LAST_10_YEARS->getPreviousDateRange()->getDateTo(), 'Incorrect previous end of LAST_10_YEARS');
45
49
$this->assertEquals('2019-12-31 23:59:59', PresetDateRanges::LIFETIME->getPreviousDateRange()->getDateTo(), 'Incorrect previous end of LIFETIME');
46
50
}
47
51
@@ -61,6 +65,8 @@ public function it_can_generate_correct_start_date(): void
61
65
$this->assertEquals('2024-07-02 00:00:00', PresetDateRanges::LAST_7_DAYS->getDateFrom(), 'Incorrect start of LAST_7_DAYS');
62
66
$this->assertEquals('2024-06-25 00:00:00', PresetDateRanges::LAST_14_DAYS->getDateFrom(), 'Incorrect start of LAST_14_DAYS');
63
67
$this->assertEquals('2024-06-09 00:00:00', PresetDateRanges::LAST_30_DAYS->getDateFrom(), 'Incorrect start of LAST_30_DAYS');
68
+
$this->assertEquals('2020-01-01 00:00:00', PresetDateRanges::LAST_5_YEARS->getDateFrom(), 'Incorrect start of LAST_5_YEARS');
69
+
$this->assertEquals('2015-01-01 00:00:00', PresetDateRanges::LAST_10_YEARS->getDateFrom(), 'Incorrect start of LAST_10_YEARS');
64
70
$this->assertEquals('2020-01-01 00:00:00', PresetDateRanges::LIFETIME->getDateFrom(), 'Incorrect start of LIFETIME');
65
71
}
66
72
@@ -80,6 +86,8 @@ public function it_can_generate_correct_end_date(): void
80
86
$this->assertEquals('2024-07-08 23:59:59', PresetDateRanges::LAST_7_DAYS->getDateTo(), 'Incorrect end of LAST_7_DAYS');
81
87
$this->assertEquals('2024-07-08 23:59:59', PresetDateRanges::LAST_14_DAYS->getDateTo(), 'Incorrect end of LAST_14_DAYS');
82
88
$this->assertEquals('2024-07-08 23:59:59', PresetDateRanges::LAST_30_DAYS->getDateTo(), 'Incorrect end of LAST_30_DAYS');
89
+
$this->assertEquals('2024-12-31 23:59:59', PresetDateRanges::LAST_5_YEARS->getDateTo(), 'Incorrect end of LAST_5_YEARS');
90
+
$this->assertEquals('2024-12-31 23:59:59', PresetDateRanges::LAST_10_YEARS->getDateTo(), 'Incorrect end of LAST_10_YEARS');
83
91
$this->assertEquals('2024-07-08 22:07:00', PresetDateRanges::LIFETIME->getDateTo(), 'Incorrect end of LIFETIME');
0 commit comments