Skip to content

Commit 8c33870

Browse files
sir-kainnicolas-grekas
authored andcommitted
[HttpFoundation] add tests for FlashBagInterface::setAll()
1 parent 3cb12ef commit 8c33870

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Tests/Session/Flash/FlashBagTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,19 @@ public function testKeys()
124124
$this->assertEquals(array('notice'), $this->bag->keys());
125125
}
126126

127+
public function testSetAll()
128+
{
129+
$this->bag->add('one_flash', 'Foo');
130+
$this->bag->add('another_flash', 'Bar');
131+
$this->assertTrue($this->bag->has('one_flash'));
132+
$this->assertTrue($this->bag->has('another_flash'));
133+
$this->bag->setAll(array('unique_flash' => 'FooBar'));
134+
$this->assertFalse($this->bag->has('one_flash'));
135+
$this->assertFalse($this->bag->has('another_flash'));
136+
$this->assertSame(array('unique_flash' => 'FooBar'), $this->bag->all());
137+
$this->assertSame(array(), $this->bag->all());
138+
}
139+
127140
public function testPeekAll()
128141
{
129142
$this->bag->set('notice', 'Foo');

0 commit comments

Comments
 (0)