Example #1
0
 /**
  * @magentoAppIsolation enabled
  */
 public function testDefaultConfiguration()
 {
     $this->assertEquals(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\Filesystem')->getPath('session'), $this->_model->getSavePath());
     $this->assertEquals(\Magento\Framework\Session\Config::COOKIE_LIFETIME_DEFAULT, $this->_model->getCookieLifetime());
     $this->assertEquals($this->_cacheLimiter, $this->_model->getCacheLimiter());
     $this->assertEquals('/', $this->_model->getCookiePath());
     $this->assertEquals('localhost', $this->_model->getCookieDomain());
     $this->assertEquals(false, $this->_model->getCookieSecure());
     $this->assertEquals(true, $this->_model->getCookieHttpOnly());
     $this->assertEquals($this->_model->getSavePath(), $this->_model->getOption('save_path'));
 }
 public function testSettingInvalidCookieLifetime2()
 {
     $validatorMock = $this->getMockBuilder('Magento\\Framework\\Validator\\ValidatorInterface')->disableOriginalConstructor()->getMock();
     $validatorMock->expects($this->any())->method('isValid')->willReturn(false);
     $this->getModel($validatorMock);
     $preVal = $this->config->getCookieLifetime();
     $this->config->setCookieLifetime(-1);
     $this->assertEquals($preVal, $this->config->getCookieLifetime());
 }
Example #3
0
 public function testSettingInvalidCookieLifetime2()
 {
     $preVal = $this->_model->getCookieLifetime();
     $this->_model->setCookieLifetime(-1);
     $this->assertEquals($preVal, $this->_model->getCookieLifetime());
 }
 public function testCookieLifetimeIsMutable()
 {
     $this->config->setCookieLifetime(20);
     $this->assertEquals(20, $this->config->getCookieLifetime());
 }