File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
src/Symfony/Component/HttpFoundation Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class MockArraySessionStorage implements SessionStorageInterface
60
60
/**
61
61
* @var array
62
62
*/
63
- protected $ bags ;
63
+ protected $ bags = array () ;
64
64
65
65
/**
66
66
* Constructor.
Original file line number Diff line number Diff line change @@ -97,6 +97,30 @@ public function testGetId()
97
97
$ this ->assertNotEquals ('' , $ this ->storage ->getId ());
98
98
}
99
99
100
+ public function testClearClearsBags ()
101
+ {
102
+ $ this ->storage ->clear ();
103
+
104
+ $ this ->assertSame (array (), $ this ->storage ->getBag ('attributes ' )->all ());
105
+ $ this ->assertSame (array (), $ this ->storage ->getBag ('flashes ' )->peekAll ());
106
+ }
107
+
108
+ public function testClearStartsSession ()
109
+ {
110
+ $ this ->storage ->clear ();
111
+
112
+ $ this ->assertTrue ($ this ->storage ->isStarted ());
113
+ }
114
+
115
+ public function testClearWithNoBagsStartsSession ()
116
+ {
117
+ $ storage = new MockArraySessionStorage ();
118
+
119
+ $ storage ->clear ();
120
+
121
+ $ this ->assertTrue ($ storage ->isStarted ());
122
+ }
123
+
100
124
/**
101
125
* @expectedException \RuntimeException
102
126
*/
You can’t perform that action at this time.
0 commit comments