Skip to content

Commit 4214997

Browse files
committed
MAGETWO-34363: Pull request processing
1 parent 40bddd9 commit 4214997

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Customer\Test\Unit\Block\Adminhtml\Edit\Tab\View;
77

88
use Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo;
9+
use Magento\Framework\Stdlib\DateTime;
910

1011
/**
1112
* Customer personal information template block test.
@@ -104,7 +105,7 @@ protected function setUp()
104105

105106
$this->localeDate = $this->getMock(
106107
'Magento\Framework\Stdlib\DateTime\Timezone',
107-
['scopeDate', 'formatDate', 'getDefaultTimezonePath'],
108+
['scopeDate', 'formatDateTime', 'getDefaultTimezonePath'],
108109
[],
109110
'',
110111
false
@@ -159,7 +160,7 @@ public function testGetStoreLastLoginDateTimezone()
159160
* @param string|null $lastLoginAt
160161
* @param string|null $lastVisitAt
161162
* @param string|null $lastLogoutAt
162-
* @return void
163+
* @return void
163164
* @dataProvider getCurrentStatusDataProvider
164165
*/
165166
public function testGetCurrentStatus($status, $lastLoginAt, $lastVisitAt, $lastLogoutAt)
@@ -168,7 +169,7 @@ public function testGetCurrentStatus($status, $lastLoginAt, $lastVisitAt, $lastL
168169
$this->customerLog->expects($this->any())->method('getLastVisitAt')->willReturn($lastVisitAt);
169170
$this->customerLog->expects($this->any())->method('getLastLogoutAt')->willReturn($lastLogoutAt);
170171

171-
$this->assertEquals($status, $this->block->getCurrentStatus());
172+
$this->assertEquals($status, (string) $this->block->getCurrentStatus());
172173
}
173174

174175
/**
@@ -180,7 +181,7 @@ public function getCurrentStatusDataProvider()
180181
['Offline', null, null, null],
181182
['Offline', '2015-03-04 11:00:00', null, '2015-03-04 12:00:00'],
182183
['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]
184185
];
185186
}
186187

@@ -193,7 +194,7 @@ public function getCurrentStatusDataProvider()
193194
public function testGetLastLoginDate($result, $lastLoginAt)
194195
{
195196
$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);
197198

198199
$this->assertEquals($result, $this->block->getLastLoginDate());
199200
}
@@ -220,7 +221,7 @@ public function testGetStoreLastLoginDate($result, $lastLoginAt)
220221
$this->customerLog->expects($this->once())->method('getLastLoginAt')->willReturn($lastLoginAt);
221222

222223
$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);
224225

225226
$this->assertEquals($result, $this->block->getStoreLastLoginDate());
226227
}

0 commit comments

Comments
 (0)