6
6
namespace Magento \Customer \Test \Unit \Block \Adminhtml \Edit \Tab \View ;
7
7
8
8
use Magento \Customer \Block \Adminhtml \Edit \Tab \View \PersonalInfo ;
9
+ use Magento \Framework \Stdlib \DateTime ;
9
10
10
11
/**
11
12
* Customer personal information template block test.
@@ -104,7 +105,7 @@ protected function setUp()
104
105
105
106
$ this ->localeDate = $ this ->getMock (
106
107
'Magento\Framework\Stdlib\DateTime\Timezone ' ,
107
- ['scopeDate ' , 'formatDate ' , 'getDefaultTimezonePath ' ],
108
+ ['scopeDate ' , 'formatDateTime ' , 'getDefaultTimezonePath ' ],
108
109
[],
109
110
'' ,
110
111
false
@@ -159,7 +160,7 @@ public function testGetStoreLastLoginDateTimezone()
159
160
* @param string|null $lastLoginAt
160
161
* @param string|null $lastVisitAt
161
162
* @param string|null $lastLogoutAt
162
- * @return void
163
+ * @return void
163
164
* @dataProvider getCurrentStatusDataProvider
164
165
*/
165
166
public function testGetCurrentStatus ($ status , $ lastLoginAt , $ lastVisitAt , $ lastLogoutAt )
@@ -168,7 +169,7 @@ public function testGetCurrentStatus($status, $lastLoginAt, $lastVisitAt, $lastL
168
169
$ this ->customerLog ->expects ($ this ->any ())->method ('getLastVisitAt ' )->willReturn ($ lastVisitAt );
169
170
$ this ->customerLog ->expects ($ this ->any ())->method ('getLastLogoutAt ' )->willReturn ($ lastLogoutAt );
170
171
171
- $ this ->assertEquals ($ status , $ this ->block ->getCurrentStatus ());
172
+ $ this ->assertEquals ($ status , ( string ) $ this ->block ->getCurrentStatus ());
172
173
}
173
174
174
175
/**
@@ -180,7 +181,7 @@ public function getCurrentStatusDataProvider()
180
181
['Offline ' , null , null , null ],
181
182
['Offline ' , '2015-03-04 11:00:00 ' , null , '2015-03-04 12:00:00 ' ],
182
183
['Offline ' , '2015-03-04 11:00:00 ' , '2015-03-04 11:40:00 ' , null ],
183
- ['Online ' , '2015-03-04 11:00:00 ' , ' 2015-03-04 11:45:00 ' , null ]
184
+ ['Online ' , '2015-03-04 11:00:00 ' , ( new \ DateTime ())-> format (DateTime:: DATETIME_PHP_FORMAT ) , null ]
184
185
];
185
186
}
186
187
@@ -193,7 +194,7 @@ public function getCurrentStatusDataProvider()
193
194
public function testGetLastLoginDate ($ result , $ lastLoginAt )
194
195
{
195
196
$ this ->customerLog ->expects ($ this ->once ())->method ('getLastLoginAt ' )->willReturn ($ lastLoginAt );
196
- $ this ->localeDate ->expects ($ this ->any ())->method ('formatDate ' )->willReturn ($ lastLoginAt );
197
+ $ this ->localeDate ->expects ($ this ->any ())->method ('formatDateTime ' )->willReturn ($ lastLoginAt );
197
198
198
199
$ this ->assertEquals ($ result , $ this ->block ->getLastLoginDate ());
199
200
}
@@ -220,7 +221,7 @@ public function testGetStoreLastLoginDate($result, $lastLoginAt)
220
221
$ this ->customerLog ->expects ($ this ->once ())->method ('getLastLoginAt ' )->willReturn ($ lastLoginAt );
221
222
222
223
$ this ->localeDate ->expects ($ this ->any ())->method ('scopeDate ' )->will ($ this ->returnValue ($ lastLoginAt ));
223
- $ this ->localeDate ->expects ($ this ->any ())->method ('formatDate ' )->willReturn ($ lastLoginAt );
224
+ $ this ->localeDate ->expects ($ this ->any ())->method ('formatDateTime ' )->willReturn ($ lastLoginAt );
224
225
225
226
$ this ->assertEquals ($ result , $ this ->block ->getStoreLastLoginDate ());
226
227
}
0 commit comments