[HttpFoundation][bugfix] should always be initialized
This commit is contained in:
parent
80af0838f5
commit
d984c73e66
@ -60,7 +60,7 @@ class MockArraySessionStorage implements SessionStorageInterface
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $bags;
|
||||
protected $bags = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -97,6 +97,30 @@ class MockArraySessionStorageTest extends TestCase
|
||||
$this->assertNotEquals('', $this->storage->getId());
|
||||
}
|
||||
|
||||
public function testClearClearsBags()
|
||||
{
|
||||
$this->storage->clear();
|
||||
|
||||
$this->assertSame(array(), $this->storage->getBag('attributes')->all());
|
||||
$this->assertSame(array(), $this->storage->getBag('flashes')->peekAll());
|
||||
}
|
||||
|
||||
public function testClearStartsSession()
|
||||
{
|
||||
$this->storage->clear();
|
||||
|
||||
$this->assertTrue($this->storage->isStarted());
|
||||
}
|
||||
|
||||
public function testClearWithNoBagsStartsSession()
|
||||
{
|
||||
$storage = new MockArraySessionStorage();
|
||||
|
||||
$storage->clear();
|
||||
|
||||
$this->assertTrue($storage->isStarted());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
|
Reference in New Issue
Block a user