Skip to content

Commit b9b72f7

Browse files
author
Vladyslav Shcherbyna
committed
MAGETWO-44815: L1, L2 are red on mainline
1 parent 74f9337 commit b9b72f7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function testGetDateRangeFirstPart($range, $customStart, $customEnd, $exp
254254
$result = $this->collection->getDateRange($range, $customStart, $customEnd);
255255
$interval = $result['to']->diff($result['from']);
256256
$intervalResult = $interval->format('%y %m %d %h:%i:%s');
257-
$this->assertEquals($expectedInterval, $intervalResult);
257+
$this->assertEquals($expectedInterval->format('%y %m %d %h:%i:%s'), $intervalResult);
258258
}
259259

260260
/**
@@ -423,10 +423,15 @@ public function useAggregatedDataDataProvider()
423423
*/
424424
public function firstPartDateRangeDataProvider()
425425
{
426+
$dt = new \DateTime();
427+
$dt->setTime(0, 0, 0);
428+
$dt1 = clone $dt;
429+
$dt2 = clone $dt;
430+
$dt3 = clone $dt;
426431
return [
427-
['', '', '', '0 0 0 23:59:59'],
428-
['24h', '', '', '0 0 1 0:0:0'],
429-
['7d', '', '', '0 0 6 23:59:59']
432+
['', '', '', $dt->diff($dt1->setTime(23, 59, 59))],
433+
['24h', '', '', $dt->diff($dt2->add(new \DateInterval('P0Y0M01DT00H00M00S')))],
434+
['7d', '', '', $dt->diff($dt3->add(new \DateInterval('P0Y0M06DT23H59M59S')))]
430435
];
431436
}
432437

0 commit comments

Comments
 (0)