@@ -278,20 +278,17 @@ public function testPrepareSummary($useAggregatedData, $mainTable, $isFilter, $g
278
278
* @param int $range
279
279
* @param string $customStart
280
280
* @param string $customEnd
281
- * @param string $expectedInterval
281
+ * @param array $expectedInterval
282
282
*
283
283
* @return void
284
284
* @dataProvider firstPartDateRangeDataProvider
285
285
*/
286
286
public function testGetDateRangeFirstPart ($ range , $ customStart , $ customEnd , $ expectedInterval ): void
287
287
{
288
- $ timeZoneToReturn = date_default_timezone_get ();
289
- date_default_timezone_set ('UTC ' );
290
288
$ result = $ this ->collection ->getDateRange ($ range , $ customStart , $ customEnd );
291
289
$ interval = $ result ['to ' ]->diff ($ result ['from ' ]);
292
- date_default_timezone_set ($ timeZoneToReturn );
293
290
$ intervalResult = $ interval ->format ('%y %m %d %h:%i:%s ' );
294
- $ this ->assertEquals ( $ expectedInterval , $ intervalResult );
291
+ $ this ->assertContains ( $ intervalResult , $ expectedInterval );
295
292
}
296
293
297
294
/**
@@ -464,9 +461,9 @@ public function useAggregatedDataDataProvider(): array
464
461
public function firstPartDateRangeDataProvider (): array
465
462
{
466
463
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 '] ]
470
467
];
471
468
}
472
469
0 commit comments