Skip to content

Commit 1ca2d9d

Browse files
Merge remote-tracking branch 'magento-l3/ACP2E-1748' into PR-L3-21-02-2023
2 parents 632daa1 + 934a688 commit 1ca2d9d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Order/CollectionTest.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)