Beispiel #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'));
 }
Beispiel #2
0
 /**
  * @dataProvider savePathDataProvider
  */
 public function testConstructorSavePath($existing, $given, $expected)
 {
     $sessionSavePath = ini_get('session.save_path');
     if ($expected === 'default') {
         $expected = $this->defaultSavePath . '/';
     }
     $setup = ini_set('session.save_path', $existing);
     if ($setup === false) {
         $this->markTestSkipped('Cannot set session.save_path with ini_set');
     }
     $this->deploymentConfigMock->expects($this->at(0))->method('get')->with(Config::PARAM_SESSION_SAVE_PATH)->will($this->returnValue($given));
     $this->_model = $this->_objectManager->create('Magento\\Framework\\Session\\Config', ['deploymentConfig' => $this->deploymentConfigMock]);
     $this->assertEquals($expected, $this->_model->getOption('save_path'));
     if ($sessionSavePath != ini_get('session.save_path')) {
         ini_set('session.save_path', $sessionSavePath);
     }
 }
 public function testSetSavePath()
 {
     $this->getModel($this->validatorMock);
     $this->config->setSavePath('some_save_path');
     $this->assertEquals($this->config->getOption('save_path'), 'some_save_path');
 }