Skip to content

Commit db95a0d

Browse files
committed
handle calling getUser in test (#22833)
1 parent 976076f commit db95a0d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/code/Magento/Security/Model/AdminSessionsManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public function processProlong()
154154
$this->getCurrentSession()->save();
155155
}
156156

157+
// todo: don't necessarily have a user here
157158
if ($this->authSession->getUser()->getExpiresAt())
158159
{
159160
$this->revokeExpiredAdminUser();

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ public function testProcessProlong()
253253
->method('save')
254254
->willReturnSelf();
255255

256+
$this->authSessionMock->expects($this->once())
257+
->method('getUser')
258+
->willReturn($this->userMock);
259+
256260
$this->model->processProlong();
257261
}
258262

0 commit comments

Comments
 (0)