File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
app/code/Magento/ImportExport Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ public function __construct(
52
52
*/
53
53
public function getExecutionTime ($ time )
54
54
{
55
- $ reportTime = $ this ->timeZone ->date ($ time, $ this -> timeZone -> getConfigTimezone () );
55
+ $ reportTime = $ this ->timeZone ->date ($ time );
56
56
$ timeDiff = $ reportTime ->diff ($ this ->timeZone ->date ());
57
- return $ timeDiff ->format ('%H:%M :%S ' );
57
+ return $ timeDiff ->format ('%H:%I :%S ' );
58
58
}
59
59
60
60
/**
Original file line number Diff line number Diff line change @@ -89,12 +89,17 @@ protected function setUp()
89
89
*/
90
90
public function testGetExecutionTime ()
91
91
{
92
- $ time = '01:02:03 ' ;
93
- $ this ->timezone ->expects ($ this ->any ())->method ('date ' )->willReturnSelf ();
94
- $ this ->timezone ->expects ($ this ->any ())->method ('getConfigTimezone ' )->willReturn ('America/Los_Angeles ' );
95
- $ this ->timezone ->expects ($ this ->any ())->method ('diff ' )->willReturnSelf ();
96
- $ this ->timezone ->expects ($ this ->any ())->method ('format ' )->willReturn ($ time );
97
- $ this ->assertEquals ($ time , $ this ->report ->getExecutionTime ($ time ));
92
+ $ startDate = '2000-01-01 01:01:01 ' ;
93
+ $ endDate = '2000-01-01 02:03:04 ' ;
94
+ $ executionTime = '01:02:03 ' ;
95
+
96
+ $ startDateMock = $ this ->createTestProxy (\DateTime::class, ['time ' => $ startDate ]);
97
+ $ endDateMock = $ this ->createTestProxy (\DateTime::class, ['time ' => $ endDate ]);
98
+ $ this ->timezone ->method ('date ' )
99
+ ->withConsecutive ([$ startDate ], [])
100
+ ->willReturnOnConsecutiveCalls ($ startDateMock , $ endDateMock );
101
+
102
+ $ this ->assertEquals ($ executionTime , $ this ->report ->getExecutionTime ($ startDate ));
98
103
}
99
104
100
105
/**
You can’t perform that action at this time.
0 commit comments