composer update
This commit is contained in:
@@ -45,7 +45,7 @@ class AttributeBagTest extends TestCase
|
||||
),
|
||||
),
|
||||
);
|
||||
$this->bag = new AttributeBag('_sf2');
|
||||
$this->bag = new AttributeBag('_sf');
|
||||
$this->bag->initialize($this->array);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class AttributeBagTest extends TestCase
|
||||
|
||||
public function testGetStorageKey()
|
||||
{
|
||||
$this->assertEquals('_sf2', $this->bag->getStorageKey());
|
||||
$this->assertEquals('_sf', $this->bag->getStorageKey());
|
||||
$attributeBag = new AttributeBag('test');
|
||||
$this->assertEquals('test', $attributeBag->getStorageKey());
|
||||
}
|
||||
|
@@ -70,6 +70,27 @@ class SessionTest extends TestCase
|
||||
$this->assertEquals('0123456789abcdef', $this->session->getId());
|
||||
}
|
||||
|
||||
public function testSetIdAfterStart()
|
||||
{
|
||||
$this->session->start();
|
||||
$id = $this->session->getId();
|
||||
|
||||
$e = null;
|
||||
try {
|
||||
$this->session->setId($id);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
$this->assertNull($e);
|
||||
|
||||
try {
|
||||
$this->session->setId('different');
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
$this->assertInstanceOf('\LogicException', $e);
|
||||
}
|
||||
|
||||
public function testSetName()
|
||||
{
|
||||
$this->assertEquals('MOCKSESSID', $this->session->getName());
|
||||
|
16
vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.expected
vendored
Normal file
16
vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.expected
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
open
|
||||
validateId
|
||||
read
|
||||
doRead:
|
||||
read
|
||||
|
||||
write
|
||||
doWrite: foo|s:3:"bar";
|
||||
close
|
||||
Array
|
||||
(
|
||||
[0] => Content-Type: text/plain; charset=utf-8
|
||||
[1] => Cache-Control: max-age=0, private, must-revalidate
|
||||
[2] => Set-Cookie: sid=random_session_id; path=/; secure; HttpOnly; SameSite=lax
|
||||
)
|
||||
shutdown
|
13
vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php
vendored
Normal file
13
vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
require __DIR__.'/common.inc';
|
||||
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
|
||||
|
||||
$storage = new NativeSessionStorage(array('cookie_samesite' => 'lax'));
|
||||
$storage->setSaveHandler(new TestSessionHandler());
|
||||
$storage->start();
|
||||
|
||||
$_SESSION = array('foo' => 'bar');
|
||||
|
||||
ob_start(function ($buffer) { return str_replace(session_id(), 'random_session_id', $buffer); });
|
@@ -0,0 +1,23 @@
|
||||
open
|
||||
validateId
|
||||
read
|
||||
doRead:
|
||||
read
|
||||
destroy
|
||||
close
|
||||
open
|
||||
validateId
|
||||
read
|
||||
doRead:
|
||||
read
|
||||
|
||||
write
|
||||
doWrite: foo|s:3:"bar";
|
||||
close
|
||||
Array
|
||||
(
|
||||
[0] => Content-Type: text/plain; charset=utf-8
|
||||
[1] => Cache-Control: max-age=0, private, must-revalidate
|
||||
[2] => Set-Cookie: sid=random_session_id; path=/; secure; HttpOnly; SameSite=lax
|
||||
)
|
||||
shutdown
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
require __DIR__.'/common.inc';
|
||||
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
|
||||
|
||||
$storage = new NativeSessionStorage(array('cookie_samesite' => 'lax'));
|
||||
$storage->setSaveHandler(new TestSessionHandler());
|
||||
$storage->start();
|
||||
|
||||
$_SESSION = array('foo' => 'bar');
|
||||
|
||||
$storage->regenerate(true);
|
||||
|
||||
ob_start(function ($buffer) { return preg_replace('~_sf2_meta.*$~m', '', str_replace(session_id(), 'random_session_id', $buffer)); });
|
@@ -45,7 +45,7 @@ class MongoDbSessionHandlerTest extends TestCase
|
||||
'data_field' => 'data',
|
||||
'time_field' => 'time',
|
||||
'expiry_field' => 'expires_at',
|
||||
'database' => 'sf2-test',
|
||||
'database' => 'sf-test',
|
||||
'collection' => 'session-test',
|
||||
);
|
||||
|
||||
|
@@ -33,7 +33,7 @@ class PdoSessionHandlerTest extends TestCase
|
||||
|
||||
protected function getPersistentSqliteDsn()
|
||||
{
|
||||
$this->dbFile = tempnam(sys_get_temp_dir(), 'sf2_sqlite_sessions');
|
||||
$this->dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_sessions');
|
||||
|
||||
return 'sqlite:'.$this->dbFile;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ class PdoSessionHandlerTest extends TestCase
|
||||
|
||||
public function testReadLockedConvertsStreamToString()
|
||||
{
|
||||
if (ini_get('session.use_strict_mode')) {
|
||||
if (filter_var(ini_get('session.use_strict_mode'), FILTER_VALIDATE_BOOLEAN)) {
|
||||
$this->markTestSkipped('Strict mode needs no locking for new sessions.');
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@ class MockArraySessionStorageTest extends TestCase
|
||||
$this->data = array(
|
||||
$this->attributes->getStorageKey() => array('foo' => 'bar'),
|
||||
$this->flashes->getStorageKey() => array('notice' => 'hello'),
|
||||
);
|
||||
);
|
||||
|
||||
$this->storage = new MockArraySessionStorage();
|
||||
$this->storage->registerBag($this->flashes);
|
||||
|
@@ -35,7 +35,7 @@ class MockFileSessionStorageTest extends TestCase
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->sessionDir = sys_get_temp_dir().'/sf2test';
|
||||
$this->sessionDir = sys_get_temp_dir().'/sftest';
|
||||
$this->storage = $this->getStorage();
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,7 @@ class NativeSessionStorageTest extends TestCase
|
||||
protected function setUp()
|
||||
{
|
||||
$this->iniSet('session.save_handler', 'files');
|
||||
$this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sf2test');
|
||||
$this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sftest');
|
||||
if (!is_dir($this->savePath)) {
|
||||
mkdir($this->savePath);
|
||||
}
|
||||
@@ -171,6 +171,10 @@ class NativeSessionStorageTest extends TestCase
|
||||
'cookie_httponly' => false,
|
||||
);
|
||||
|
||||
if (\PHP_VERSION_ID >= 70300) {
|
||||
$options['cookie_samesite'] = 'lax';
|
||||
}
|
||||
|
||||
$this->getStorage($options);
|
||||
$temp = session_get_cookie_params();
|
||||
$gco = array();
|
||||
|
@@ -32,7 +32,7 @@ class PhpBridgeSessionStorageTest extends TestCase
|
||||
protected function setUp()
|
||||
{
|
||||
$this->iniSet('session.save_handler', 'files');
|
||||
$this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sf2test');
|
||||
$this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sftest');
|
||||
if (!is_dir($this->savePath)) {
|
||||
mkdir($this->savePath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user