Skip to content

Commit 38e785c

Browse files
committed
MAGETWO-83589: Vulnerability related to active login session
1 parent 772acf1 commit 38e785c

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,19 +1318,15 @@ private function reInitModel()
13181318
]
13191319
)
13201320
->getMock();
1321-
13221321
$this->customerSecure
13231322
->expects($this->any())
13241323
->method('getRpToken')
13251324
->willReturn('newStringToken');
1326-
13271325
$pastDateTime = '2016-10-25 00:00:00';
1328-
13291326
$this->customerSecure
13301327
->expects($this->any())
13311328
->method('getRpTokenCreatedAt')
13321329
->willReturn($pastDateTime);
1333-
13341330
$this->customer = $this->getMockBuilder(\Magento\Customer\Model\Customer::class)
13351331
->disableOriginalConstructor()
13361332
->setMethods(['getResetPasswordLinkExpirationPeriod'])
@@ -1363,17 +1359,14 @@ private function reInitModel()
13631359
->method('format')
13641360
->with(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT)
13651361
->willReturn($dateTime);
1366-
13671362
$dateTimeMock
13681363
->expects($this->any())
13691364
->method('getTimestamp')
13701365
->willReturn($timestamp);
1371-
13721366
$dateTimeMock
13731367
->expects($this->any())
13741368
->method('setTimestamp')
13751369
->willReturnSelf();
1376-
13771370
$dateTimeFactory = $this->getMockBuilder(DateTimeFactory::class)
13781371
->disableOriginalConstructor()
13791372
->setMethods(['create'])
@@ -1400,10 +1393,11 @@ private function reInitModel()
14001393
'transportBuilder' => $this->transportBuilder,
14011394
]
14021395
);
1403-
$reflection = new \ReflectionClass(get_class($this->accountManagement));
1404-
$reflectionProperty = $reflection->getProperty('authentication');
1405-
$reflectionProperty->setAccessible(true);
1406-
$reflectionProperty->setValue($this->accountManagement, $this->authenticationMock);
1396+
$this->objectManagerHelper->setBackwardCompatibleProperty(
1397+
$this->accountManagement,
1398+
'authentication',
1399+
$this->authenticationMock
1400+
);
14071401
}
14081402

14091403
/**

0 commit comments

Comments
 (0)