Skip to content

Commit b407c8c

Browse files
committed
fix crontab definition, copyright (#22833: Short-term admin accounts)
1 parent 071f993 commit b407c8c

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AdminSessionsManagerTest extends \PHPUnit\Framework\TestCase
5050
/** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */
5151
protected $objectManager;
5252

53-
/**
53+
/*
5454
* @var RemoteAddress
5555
*/
5656
protected $remoteAddressMock;
@@ -91,9 +91,7 @@ public function setUp()
9191
['create']
9292
);
9393

94-
$this->currentSessionMock = $this->createPartialMock(
95-
\Magento\Security\Model\AdminSessionInfo::class,
96-
[
94+
$this->currentSessionMock = $this->createPartialMock(\Magento\Security\Model\AdminSessionInfo::class, [
9795
'isActive',
9896
'getStatus',
9997
'load',
@@ -103,8 +101,7 @@ public function setUp()
103101
'getUserId',
104102
'getSessionId',
105103
'getUpdatedAt'
106-
]
107-
);
104+
]);
108105

109106
$this->securityConfigMock = $this->getMockBuilder(\Magento\Security\Model\ConfigInterface::class)
110107
->disableOriginalConstructor()
@@ -154,7 +151,7 @@ public function testProcessLogin()
154151
->method('getSessionId')
155152
->willReturn($sessionId);
156153

157-
$this->authSessionMock->expects($this->any())
154+
$this->authSessionMock->expects($this->once())
158155
->method('getUser')
159156
->willReturn($this->userMock);
160157
$this->userMock->expects($this->once())
@@ -256,10 +253,6 @@ public function testProcessProlong()
256253
->method('save')
257254
->willReturnSelf();
258255

259-
$this->authSessionMock->expects($this->once())
260-
->method('getUser')
261-
->willReturn($this->userMock);
262-
263256
$this->model->processProlong();
264257
}
265258

app/code/Magento/Security/etc/crontab.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<job name="security_clean_password_reset_request_event_records" instance="Magento\Security\Model\SecurityManager" method="cleanExpiredRecords">
1414
<schedule>0 0 * * *</schedule>
1515
</job>
16-
<job name="security_expire_users" instance="Magento\Security\DisableExpiredUsers" method="deactivateExpiredUsers">
16+
<job name="security_expire_users" instance="Magento\Security\Model\UserExpirationManager" method="deactivateExpiredUsers">
1717
<schedule>0 * * * *</schedule>
1818
</job>
1919
</group>

app/code/Magento/Security/etc/events.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
28
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
39
xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
410
<event name="admin_user_save_after">

0 commit comments

Comments
 (0)