8000 [HttpFoundation] update phpdoc of FlashBagInterface::add() · symfony/symfony@9135e18 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9135e18

Browse files
sir-kainnicolas-grekas
authored andcommitted
[HttpFoundation] update phpdoc of FlashBagInterface::add()
1 parent 306c627 commit 9135e18

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface FlashBagInterface extends SessionBagInterface
2424
* Adds a flash message for type.
2525
*
2626
* @param string $type
27-
* @param string $message
27+
* @param mixed $message
2828
*/
2929
public function add($type, $message);
3030

src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ public function testPeek()
7474
$this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
7575
}
7676

77+
public function testAdd()
78+
{
79+
$tab = array('bar' => 'baz');
80+
$this->bag->add('string_message', 'lorem');
81+
$this->bag->add('object_message', new \stdClass());
82+
$this->bag->add('array_message', $tab);
83+
84+
$this->assertEquals(array('lorem'), $this->bag->get('string_message'));
85+
$this->assertEquals(array(new \stdClass()), $this->bag->get('object_message'));
86+
$this->assertEquals(array($tab), $this->bag->get('array_message'));
87+
}
88+
7789
public function testGet()
7890
{
7991
$this->assertEquals(array(), $this->bag->get('non_existing'));

0 commit comments

Comments
 (0)
0