Skip to content

Commit fd6382b

Browse files
authored
Update AdminSessionInfoTest.php
unit test case added - kanhaiya5590@32a742e
1 parent 29cd307 commit fd6382b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,26 @@ public function dataProviderSessionLifetime()
127127
];
128128
}
129129

130+
/**
131+
* @return void
132+
*/
133+
public function testSessionExpiredWhenUpdatedAtIsNull()
134+
{
135+
$timestamp = time();
136+
$sessionLifetime = '1';
137+
138+
$this->securityConfigMock->expects($this->once())
139+
->method('getAdminSessionLifetime')
140+
->willReturn($sessionLifetime);
141+
142+
$this->dateTimeMock->expects($this->once())
143+
->method('gmtTimestamp')
144+
->willReturn($timestamp);
145+
146+
$this->model->setUpdatedAt(null);
147+
$this->assertTrue($this->model->isSessionExpired());
148+
}
149+
130150
/**
131151
* @return void
132152
*/

0 commit comments

Comments
 (0)