@@ -37,6 +37,13 @@ class AdminSessionsManagerTest extends \PHPUnit_Framework_TestCase
37
37
*/
38
38
protected $ objectManager ;
39
39
40
+ /**
41
+ * Session Manager.
42
+ *
43
+ * @var \Magento\Framework\Session\SessionManager
44
+ */
45
+ private $ sessionManager ;
46
+
40
47
/**
41
48
* Set up
42
49
*/
@@ -45,14 +52,15 @@ protected function setUp()
45
52
parent ::setUp ();
46
53
47
54
$ 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)
49
57
->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 );
53
61
$ 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 );
56
64
}
57
65
58
66
/**
@@ -111,7 +119,7 @@ public function testIsAdminSessionIsCreated()
111
119
*/
112
120
public function testTerminateOtherSessionsProcessLogin ()
113
121
{
114
- $ session = $ this ->objectManager ->create (' Magento\Security\Model\AdminSessionInfo ' );
122
+ $ session = $ this ->objectManager ->create (\ Magento \Security \Model \AdminSessionInfo::class );
115
123
$ session ->setSessionId ('669e2e3d752e8 ' )
116
124
->setUserId (1 )
117
125
->setStatus (1 )
@@ -158,7 +166,7 @@ public function testGetCurrentSession()
158
166
public function testLogoutOtherUserSessions ()
159
167
{
160
168
/** @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 );
162
170
$ session ->setSessionId ('669e2e3d752e8 ' )
163
171
->setUserId (1 )
164
172
->setStatus (1 )
@@ -207,7 +215,7 @@ protected function getCollectionForLogoutOtherUserSessions(\Magento\Security\Mod
207
215
public function testCleanExpiredSessions ()
208
216
{
209
217
/** @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 );
211
219
$ collection = $ this ->getCollectionForCleanExpiredSessions ($ session );
212
220
$ sizeBefore = $ collection ->getSize ();
213
221
$ this ->adminSessionsManager ->cleanExpiredSessions ();
0 commit comments