@@ -128,4 +128,54 @@ public function testPublicMailSubject()
128
128
$ headers = $ email ->getPreparedHeaders ();
129
129
$ this ->assertSame ('Foo ' , $ headers ->get ('Subject ' )->getValue ());
130
130
}
131
+
132
+ public function testContext ()
133
+ {
134
+ $ email = new NotificationEmail ();
135
+ $ email ->context (['some ' => 'context ' ]);
136
+
137
+ $ this ->assertSame ([
138
+ 'importance ' => NotificationEmail::IMPORTANCE_LOW ,
139
+ 'content ' => '' ,
140
+ 'exception ' => false ,
141
+ 'action_text ' => null ,
142
+ 'action_url ' => null ,
143
+ 'markdown ' => false ,
144
+ 'raw ' => false ,
145
+ 'footer_text ' => 'Notification e-mail sent by Symfony ' ,
146
+ 'some ' => 'context ' ,
147
+ ], $ email ->getContext ());
148
+
149
+ $ context = $ email ->getContext ();
150
+ $ context ['foo ' ] = 'bar ' ;
151
+ $ email ->context ($ context );
152
+
153
+ $ this ->assertSame ([
154
+ 'importance ' => NotificationEmail::IMPORTANCE_LOW ,
155
+ 'content ' => '' ,
156
+ 'exception ' => false ,
157
+ 'action_text ' => null ,
158
+ 'action_url ' => null ,
159
+ 'markdown ' => false ,
160
+ 'raw ' => false ,
161
+ 'footer_text ' => 'Notification e-mail sent by Symfony ' ,
162
+ 'some ' => 'context ' ,
163
+ 'foo ' => 'bar ' ,
164
+ ], $ email ->getContext ());
165
+
166
+ $ email ->action ('Action Text ' , 'Action URL ' );
167
+
168
+ $ this ->assertSame ([
169
+ 'importance ' => NotificationEmail::IMPORTANCE_LOW ,
170
+ 'content ' => '' ,
171
+ 'exception ' => false ,
172
+ 'action_text ' => 'Action Text ' ,
173
+ 'action_url ' => 'Action URL ' ,
174
+ 'markdown ' => false ,
175
+ 'raw ' => false ,
176
+ 'footer_text ' => 'Notification e-mail sent by Symfony ' ,
177
+ 'some ' => 'context ' ,
178
+ 'foo ' => 'bar ' ,
179
+ ], $ email ->getContext ());
180
+ }
131
181
}
0 commit comments