5
5
*/
6
6
namespace Magento \Framework \Session \Test \Unit \SaveHandler \Redis ;
7
7
8
+ use Magento \Store \Model \ScopeInterface ;
8
9
use Magento \Framework \Session \SaveHandler \Redis \Config ;
9
10
10
11
class ConfigTest extends \PHPUnit_Framework_TestCase
@@ -25,7 +26,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
25
26
private $ scopeConfigMock ;
26
27
27
28
/**
28
- * @var \Magento\Framework\Session\SaveHandler\Redis\ Config
29
+ * @var Config
29
30
*/
30
31
private $ config ;
31
32
@@ -37,7 +38,7 @@ public function setUp()
37
38
38
39
$ objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
39
40
$ this ->config = $ objectManager ->getObject (
40
- \ Magento \ Framework \ Session \ SaveHandler \ Redis \ Config::class,
41
+ Config::class,
41
42
[
42
43
'deploymentConfig ' => $ this ->deploymentConfigMock ,
43
44
'appState ' => $ this ->appStateMock ,
@@ -148,8 +149,7 @@ public function testGetMaxConcurrency()
148
149
149
150
public function testGetMaxLifetime ()
150
151
{
151
- $ expected = 31536000 ;
152
- $ this ->assertEquals ($ this ->config ->getMaxLifetime (), $ expected );
152
+ $ this ->assertEquals ($ this ->config ->getMaxLifetime (), Config::SESSION_MAX_LIFETIME );
153
153
}
154
154
155
155
public function testGetMinLifetime ()
@@ -225,7 +225,7 @@ public function testGetLifetimeAdmin()
225
225
->willReturn ($ areaCode );
226
226
$ this ->scopeConfigMock ->expects ($ this ->once ())
227
227
->method ('getValue ' )
228
- ->with (\ Magento \ Framework \ Session \ SaveHandler \ Redis \ Config::XML_PATH_ADMIN_SESSION_LIFETIME )
228
+ ->with (Config::XML_PATH_ADMIN_SESSION_LIFETIME )
229
229
->willReturn ($ expectedLifetime );
230
230
$ this ->assertEquals ($ this ->config ->getLifetime (), $ expectedLifetime );
231
231
}
@@ -240,8 +240,8 @@ public function testGetLifetimeFrontend()
240
240
$ this ->scopeConfigMock ->expects ($ this ->once ())
241
241
->method ('getValue ' )
242
242
->with (
243
- \ Magento \ Framework \ Session \ SaveHandler \ Redis \ Config::XML_PATH_COOKIE_LIFETIME ,
244
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
243
+ Config::XML_PATH_COOKIE_LIFETIME ,
244
+ ScopeInterface::SCOPE_STORE
245
245
)
246
246
->willReturn ($ expectedLifetime );
247
247
$ this ->assertEquals ($ this ->config ->getLifetime (), $ expectedLifetime );
0 commit comments