Skip to content

Commit

Permalink
fix crontab definition, copyright (#22833: Short-term admin accounts)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfolco committed Jun 30, 2019
1 parent 071f993 commit b407c8c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AdminSessionsManagerTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */
protected $objectManager;

/**
/*
* @var RemoteAddress
*/
protected $remoteAddressMock;
Expand Down Expand Up @@ -91,9 +91,7 @@ public function setUp()
['create']
);

$this->currentSessionMock = $this->createPartialMock(
\Magento\Security\Model\AdminSessionInfo::class,
[
$this->currentSessionMock = $this->createPartialMock(\Magento\Security\Model\AdminSessionInfo::class, [
'isActive',
'getStatus',
'load',
Expand All @@ -103,8 +101,7 @@ public function setUp()
'getUserId',
'getSessionId',
'getUpdatedAt'
]
);
]);

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

$this->authSessionMock->expects($this->any())
$this->authSessionMock->expects($this->once())
->method('getUser')
->willReturn($this->userMock);
$this->userMock->expects($this->once())
Expand Down Expand Up @@ -256,10 +253,6 @@ public function testProcessProlong()
->method('save')
->willReturnSelf();

$this->authSessionMock->expects($this->once())
->method('getUser')
->willReturn($this->userMock);

$this->model->processProlong();
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Security/etc/crontab.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<job name="security_clean_password_reset_request_event_records" instance="Magento\Security\Model\SecurityManager" method="cleanExpiredRecords">
<schedule>0 0 * * *</schedule>
</job>
<job name="security_expire_users" instance="Magento\Security\DisableExpiredUsers" method="deactivateExpiredUsers">
<job name="security_expire_users" instance="Magento\Security\Model\UserExpirationManager" method="deactivateExpiredUsers">
<schedule>0 * * * *</schedule>
</job>
</group>
Expand Down
6 changes: 6 additions & 0 deletions app/code/Magento/Security/etc/events.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="admin_user_save_after">
Expand Down

0 comments on commit b407c8c

Please sign in to comment.