Skip to content

Commit 34a5905

Browse files
committed
MAGETWO-61916: [BP to 2.1][Performance][Customer] replace inefficient algorithm for url rewrites on category save page
1 parent 28ec0ee commit 34a5905

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

dev/tests/integration/testsuite/Magento/Security/Model/AdminSessionsManagerTest.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ class AdminSessionsManagerTest extends \PHPUnit_Framework_TestCase
3737
*/
3838
protected $objectManager;
3939

40+
/**
41+
* Session Manager.
42+
*
43+
* @var \Magento\Framework\Session\SessionManager
44+
*/
45+
private $sessionManager;
46+
4047
/**
4148
* Set up
4249
*/
@@ -45,14 +52,15 @@ protected function setUp()
4552
parent::setUp();
4653

4754
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
48-
$this->objectManager->get('Magento\Framework\Config\ScopeInterface')
55+
$this->sessionManager = $this->objectManager->create(\Magento\Framework\Session\SessionManager::class);
56+
$this->objectManager->get(\Magento\Framework\Config\ScopeInterface::class)
4957
->setCurrentScope(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE);
50-
$this->auth = $this->objectManager->create('Magento\Backend\Model\Auth');
51-
$this->authSession = $this->objectManager->create('Magento\Backend\Model\Auth\Session');
52-
$this->adminSessionInfo = $this->objectManager->create('Magento\Security\Model\AdminSessionInfo');
58+
$this->auth = $this->objectManager->create(\Magento\Backend\Model\Auth::class);
59+
$this->authSession = $this->objectManager->create(\Magento\Backend\Model\Auth\Session::class);
60+
$this->adminSessionInfo = $this->objectManager->create(\Magento\Security\Model\AdminSessionInfo::class);
5361
$this->auth->setAuthStorage($this->authSession);
54-
$this->messageManager = $this->objectManager->get('Magento\Framework\Message\ManagerInterface');
55-
$this->adminSessionsManager = $this->objectManager->create('Magento\Security\Model\AdminSessionsManager');
62+
$this->messageManager = $this->objectManager->get(\Magento\Framework\Message\ManagerInterface::class);
63+
$this->adminSessionsManager = $this->objectManager->create(\Magento\Security\Model\AdminSessionsManager::class);
5664
}
5765

5866
/**
@@ -111,7 +119,7 @@ public function testIsAdminSessionIsCreated()
111119
*/
112120
public function testTerminateOtherSessionsProcessLogin()
113121
{
114-
$session = $this->objectManager->create('Magento\Security\Model\AdminSessionInfo');
122+
$session = $this->objectManager->create(\Magento\Security\Model\AdminSessionInfo::class);
115123
$session->setSessionId('669e2e3d752e8')
116124
->setUserId(1)
117125
->setStatus(1)
@@ -158,7 +166,7 @@ public function testGetCurrentSession()
158166
public function testLogoutOtherUserSessions()
159167
{
160168
/** @var \Magento\Security\Model\AdminSessionInfo $session */
161-
$session = $this->objectManager->create('Magento\Security\Model\AdminSessionInfo');
169+
$session = $this->objectManager->create(\Magento\Security\Model\AdminSessionInfo::class);
162170
$session->setSessionId('669e2e3d752e8')
163171
->setUserId(1)
164172
->setStatus(1)
@@ -207,7 +215,7 @@ protected function getCollectionForLogoutOtherUserSessions(\Magento\Security\Mod
207215
public function testCleanExpiredSessions()
208216
{
209217
/** @var \Magento\Security\Model\AdminSessionInfo $session */
210-
$session = $this->objectManager->create('Magento\Security\Model\AdminSessionInfo');
218+
$session = $this->objectManager->create(\Magento\Security\Model\AdminSessionInfo::class);
211219
$collection = $this->getCollectionForCleanExpiredSessions($session);
212220
$sizeBefore = $collection->getSize();
213221
$this->adminSessionsManager->cleanExpiredSessions();

0 commit comments

Comments
 (0)