@@ -179,6 +179,28 @@ public function testLoadFormatListenerWithSingleRule()
179179 $ this ->assertTrue ($ this ->container ->hasDefinition ('fos_rest.format_listener ' ));
180180 }
181181
182+ public function testLoadParamFetcherListener ()
183+ {
184+ $ config = array (
185+ 'fos_rest ' => array ('param_fetcher_listener ' => true ),
186+ );
187+ $ this ->extension ->load ($ config , $ this ->container );
188+
189+ $ this ->assertTrue ($ this ->container ->hasDefinition ('fos_rest.param_fetcher_listener ' ));
190+ $ this ->assertFalse ($ this ->container ->getParameter ('fos_rest.param_fetcher_listener.set_params_as_attributes ' ));
191+ }
192+
193+ public function testLoadParamFetcherListenerForce ()
194+ {
195+ $ config = array (
196+ 'fos_rest ' => array ('param_fetcher_listener ' => 'force ' ),
197+ );
198+ $ this ->extension ->load ($ config , $ this ->container );
199+
200+ $ this ->assertTrue ($ this ->container ->hasDefinition ('fos_rest.param_fetcher_listener ' ));
201+ $ this ->assertTrue ($ this ->container ->getParameter ('fos_rest.param_fetcher_listener.set_params_as_attributes ' ));
202+ }
203+
182204 public function testLoadFormatListenerWithMultipleRule ()
183205 {
184206 $ config = array (
@@ -224,6 +246,28 @@ public function testDisableViewResponseListener()
224246 $ this ->assertFalse ($ this ->container ->hasDefinition ('fos_rest.view_response_listener ' ));
225247 }
226248
249+ public function testLoadViewResponseListener ()
250+ {
251+ $ config = array (
252+ 'fos_rest ' => array ('view ' => array ('view_response_listener ' => true )),
253+ );
254+ $ this ->extension ->load ($ config , $ this ->container );
255+
256+ $ this ->assertTrue ($ this ->container ->hasDefinition ('fos_rest.view_response_listener ' ));
257+ $ this ->assertFalse ($ this ->container ->getParameter ('fos_rest.view_response_listener.force_view ' ));
258+ }
259+
260+ public function testLoadViewResponseListenerForce ()
261+ {
262+ $ config = array (
263+ 'fos_rest ' => array ('view ' => array ('view_response_listener ' => 'force ' )),
264+ );
265+ $ this ->extension ->load ($ config , $ this ->container );
266+
267+ $ this ->assertTrue ($ this ->container ->hasDefinition ('fos_rest.view_response_listener ' ));
268+ $ this ->assertTrue ($ this ->container ->getParameter ('fos_rest.view_response_listener.force_view ' ));
269+ }
270+
227271 public function testForceEmptyContentDefault ()
228272 {
229273 $ this ->extension ->load (array (), $ this ->container );
0 commit comments