@@ -261,44 +261,6 @@ public function testIsCsrfTokenValid()
261
261
262
262
$ this ->assertTrue ($ controller ->isCsrfTokenValid ('foo ' , 'bar ' ));
263
263
}
264
- }
265
-
266
- class TestController extends Controller
267
- {
268
- public function forward ($ controller , array $ path = array (), array $ query = array ())
269
- {
270
- return parent ::forward ($ controller , $ path , $ query );
271
- }
272
-
273
- public function getUser ()
274
- {
275
- return parent ::getUser ();
276
- }
277
-
278
- public function isGranted ($ attributes , $ object = null )
279
- {
280
- return parent ::isGranted ($ attributes , $ object );
281
- }
282
-
283
- public function denyAccessUnlessGranted ($ attributes , $ object = null , $ message = 'Access Denied. ' )
284
- {
285
- parent ::denyAccessUnlessGranted ($ attributes , $ object , $ message );
286
- }
287
-
288
- public function redirectToRoute ($ route , array $ parameters = array (), $ status = 302 )
289
- {
290
- return parent ::redirectToRoute ($ route , $ parameters , $ status );
291
- }
292
-
293
- public function addFlash ($ type , $ message )
294
- {
295
- parent ::addFlash ($ type , $ message );
296
- }
297
-
298
- public function isCsrfTokenValid ($ id , $ token )
299
- {
300
- return parent ::isCsrfTokenValid ($ id , $ token );
301
- }
302
264
303
265
public function testGenerateUrl ()
304
266
{
@@ -330,7 +292,8 @@ public function testRenderViewTemplating()
330
292
$ templating ->expects ($ this ->once ())->method ('render ' )->willReturn ('bar ' );
331
293
332
294
$ container = $ this ->getMock ('Symfony\Component\DependencyInjection\ContainerInterface ' );
333
- $ container ->expects ($ this ->at (0 ))->method ('get ' )->will ($ this ->returnValue ($ templating ));
295
+ $ container ->expects ($ this ->at (0 ))->method ('has ' )->willReturn (true );
296
+ $ container ->expects ($ this ->at (1 ))->method ('get ' )->will ($ this ->returnValue ($ templating ));
334
297
335
298
$ controller = new Controller ();
336
299
$ controller ->setContainer ($ container );
@@ -344,7 +307,8 @@ public function testRenderTemplating()
344
307
$ templating ->expects ($ this ->once ())->method ('renderResponse ' )->willReturn (new Response ('bar ' ));
345
308
346
309
$ container = $ this ->getMock ('Symfony\Component\DependencyInjection\ContainerInterface ' );
347
- $ container ->expects ($ this ->at (0 ))->method ('get ' )->will ($ this ->returnValue ($ templating ));
310
+ $ container ->expects ($ this ->at (0 ))->method ('has ' )->willReturn (true );
311
+ $ container ->expects ($ this ->at (1 ))->method ('get ' )->will ($ this ->returnValue ($ templating ));
348
312
349
313
$ controller = new Controller ();
350
314
$ controller ->setContainer ($ container );
@@ -357,7 +321,8 @@ public function testStreamTemplating()
357
321
$ templating = $ this ->getMock ('Symfony\Component\Routing\RouterInterface ' );
358
322
359
323
$ container = $ this ->getMock ('Symfony\Component\DependencyInjection\ContainerInterface ' );
360
- $ container ->expects ($ this ->at (0 ))->method ('get ' )->will ($ this ->returnValue ($ templating ));
324
+ $ container ->expects ($ this ->at (0 ))->method ('has ' )->willReturn (true );
325
+ $ container ->expects ($ this ->at (1 ))->method ('get ' )->will ($ this ->returnValue ($ templating ));
361
326
362
327
$ controller = new Controller ();
363
328
$ controller ->setContainer ($ container );
@@ -418,3 +383,41 @@ public function testGetDoctrine()
418
383
$ this ->assertEquals ($ doctrine , $ controller ->getDoctrine ());
419
384
}
420
385
}
386
+
387
+ class TestController extends Controller
388
+ {
389
+ public function forward ($ controller , array $ path = array (), array $ query = array ())
390
+ {
391
+ return parent ::forward ($ controller , $ path , $ query );
392
+ }
393
+
394
+ public function getUser ()
395
+ {
396
+ return parent ::getUser ();
397
+ }
398
+
399
+ public function isGranted ($ attributes , $ object = null )
400
+ {
401
+ return parent ::isGranted ($ attributes , $ object );
402
+ }
403
+
404
+ public function denyAccessUnlessGranted ($ attributes , $ object = null , $ message = 'Access Denied. ' )
405
+ {
406
+ parent ::denyAccessUnlessGranted ($ attributes , $ object , $ message );
407
+ }
408
+
409
+ public function redirectToRoute ($ route , array $ parameters = array (), $ status = 302 )
410
+ {
411
+ return parent ::redirectToRoute ($ route , $ parameters , $ status );
412
+ }
413
+
414
+ public function addFlash ($ type , $ message )
415
+ {
416
+ parent ::addFlash ($ type , $ message );
417
+ }
418
+
419
+ public function isCsrfTokenValid ($ id , $ token )
420
+ {
421
+ return parent ::isCsrfTokenValid ($ id , $ token );
422
+ }
423
+ }
0 commit comments