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'));
 }
 public function testSettingInvalidCookieDomain2()
 {
     $validatorMock = $this->getMockBuilder('Magento\\Framework\\Validator\\ValidatorInterface')->disableOriginalConstructor()->getMock();
     $validatorMock->expects($this->any())->method('isValid')->willReturn(false);
     $this->getModel($validatorMock);
     $preVal = $this->config->getCookieDomain();
     $this->config->setCookieDomain('D:\\WINDOWS\\System32\\drivers\\etc\\hosts');
     $this->assertEquals($preVal, $this->config->getCookieDomain());
 }
Beispiel #3
0
 public function testSettingInvalidCookieDomain2()
 {
     $preVal = $this->_model->getCookieDomain();
     $this->_model->setCookieDomain('D:\\WINDOWS\\System32\\drivers\\etc\\hosts');
     $this->assertEquals($preVal, $this->_model->getCookieDomain());
 }
 public function testCookieDomainCanBeEmpty()
 {
     $this->config->setCookieDomain('');
     $this->assertEquals('', $this->config->getCookieDomain());
 }