File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/Symfony/Component/HttpFoundation Expand file tree
10000
path> Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ interface FlashBagInterface extends SessionBagInterface
24
24
* Adds a flash message for type.
25
25
*
26
26
* @param string $type
27
- * @param string $message
27
+ * @param mixed $message
28
28
*/
29
29
public function add ($ type , $ message );
30
30
Original file line number Diff line number Diff line change @@ -74,6 +74,18 @@ public function testPeek()
74
74
$ this ->assertEquals (array ('A previous flash message ' ), $ this ->bag ->peek ('notice ' ));
75
75
}
76
76
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
+
77
89
public function testGet ()
78
90
{
79
91
$ this ->assertEquals (array (), $ this ->bag ->get ('non_existing ' ));
You can’t perform that action at this time.
0 commit comments