@@ -278,20 +278,17 @@ public function testPrepareSummary($useAggregatedData, $mainTable, $isFilter, $g
278278 * @param int $range
279279 * @param string $customStart
280280 * @param string $customEnd
281- * @param string $expectedInterval
281+ * @param array $expectedInterval
282282 *
283283 * @return void
284284 * @dataProvider firstPartDateRangeDataProvider
285285 */
286286 public function testGetDateRangeFirstPart ($ range , $ customStart , $ customEnd , $ expectedInterval ): void
287287 {
288- $ timeZoneToReturn = date_default_timezone_get ();
289- date_default_timezone_set ('UTC ' );
290288 $ result = $ this ->collection ->getDateRange ($ range , $ customStart , $ customEnd );
291289 $ interval = $ result ['to ' ]->diff ($ result ['from ' ]);
292- date_default_timezone_set ($ timeZoneToReturn );
293290 $ intervalResult = $ interval ->format ('%y %m %d %h:%i:%s ' );
294- $ this ->assertEquals ( $ expectedInterval , $ intervalResult );
291+ $ this ->assertContains ( $ intervalResult , $ expectedInterval );
295292 }
296293
297294 /**
@@ -464,9 +461,9 @@ public function useAggregatedDataDataProvider(): array
464461 public function firstPartDateRangeDataProvider (): array
465462 {
466463 return [
467- ['' , '' , '' , '0 0 0 23:59:59 ' ],
468- ['24h ' , '' , '' , '0 0 1 0:0:0 ' ],
469- ['7d ' , '' , '' , '0 0 6 22:59:59 ' ]
464+ ['' , '' , '' , [ '0 0 0 23:59:59 ' , ' 0 0 1 0:59:59 ' , ' 0 0 0 22:59:59 ' ] ],
465+ ['24h ' , '' , '' , [ '0 0 1 0:0:0 ' , ' 0 0 1 1:0:0 ' , ' 0 0 0 23:0:0 ' ] ],
466+ ['7d ' , '' , '' , [ '0 0 6 23:59:59 ' , ' 0 0 7 0:59:59 ' , ' 0 0 6 22:59:59 '] ]
470467 ];
471468 }
472469
0 commit comments