Skip to content

Commit fa82a64

Browse files
authored
Update AdminSessionsManagerTest.php
test case Tjitse-E@32a742e thanks to @Tjitse-E - https://github.com/Tjitse-E/
1 parent fd6382b commit fa82a64

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

app/code/Magento/Security/Test/Unit/Model/AdminSessionsManagerTest.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,48 @@ public function testProcessProlong()
255255
$this->model->processProlong();
256256
}
257257

258+
/**
259+
* @return void
260+
*/
261+
public function testUpdatedAtIsNull()
262+
{
263+
$newUpdatedAt = '2016-01-01 00:00:30';
264+
$adminSessionInfoId = 50;
265+
$this->authSessionMock->expects($this->any())
266+
->method('getAdminSessionInfoId')
267+
->willReturn($adminSessionInfoId);
268+
269+
$this->adminSessionInfoFactoryMock->expects($this->any())
270+
->method('create')
271+
->willReturn($this->currentSessionMock);
272+
273+
$this->currentSessionMock->expects($this->once())
274+
->method('load')
275+
->willReturnSelf();
276+
277+
$this->currentSessionMock->expects($this->once())
278+
->method('getUpdatedAt')
279+
->willReturn(null);
280+
281+
$this->authSessionMock->expects($this->once())
282+
->method('getUpdatedAt')
283+
->willReturn(strtotime($newUpdatedAt));
284+
285+
$this->securityConfigMock->expects($this->once())
286+
->method('getAdminSessionLifetime')
287+
->willReturn(100);
288+
289+
$this->currentSessionMock->expects($this->never())
290+
->method('setData')
291+
->willReturnSelf();
292+
293+
$this->currentSessionMock->expects($this->never())
294+
->method('save')
295+
->willReturnSelf();
296+
297+
$this->model->processProlong();
298+
}
299+
258300
/**
259301
* @return void
260302
*/

0 commit comments

Comments
 (0)