19
19
use Symfony \Component \HttpFoundation \Request ;
20
20
use Symfony \Component \HttpFoundation \Response ;
21
21
use Symfony \Component \HttpKernel \Event \ExceptionEvent ;
22
+ use Symfony \Component \HttpKernel \EventListener \ErrorListener ;
22
23
use Symfony \Component \HttpKernel \HttpKernelInterface ;
23
24
24
25
/**
@@ -44,7 +45,7 @@ public function testOnKernelException(Request $request)
44
45
$ eventProphecy ->getKernel ()->willReturn ($ kernel );
45
46
$ eventProphecy ->setResponse (Argument::type (Response::class))->shouldBeCalled ();
46
47
47
- $ listener = new ExceptionListener ('foo:bar ' );
48
+ $ listener = new ExceptionListener ('foo:bar ' , null , false , class_exists (ErrorListener::class) ? $ this -> prophesize (ErrorListener::class)-> reveal () : null );
48
49
$ listener ->onKernelException ($ eventProphecy ->reveal ());
49
50
}
50
51
@@ -62,7 +63,7 @@ public function testDoNothingWhenNotAnApiCall()
62
63
$ eventProphecy ->getRequest ()->willReturn (new Request ());
63
64
$ eventProphecy ->setResponse (Argument::type (Response::class))->shouldNotBeCalled ();
64
65
65
- $ listener = new ExceptionListener ('foo:bar ' );
66
+ $ listener = new ExceptionListener ('foo:bar ' , null , false , class_exists (ErrorListener::class) ? $ this -> prophesize (ErrorListener::class)-> reveal () : null );
66
67
$ listener ->onKernelException ($ eventProphecy ->reveal ());
67
68
}
68
69
@@ -75,7 +76,7 @@ public function testDoNothingWhenHtmlRequested()
75
76
$ eventProphecy ->getRequest ()->willReturn ($ request );
76
77
$ eventProphecy ->setResponse (Argument::type (Response::class))->shouldNotBeCalled ();
77
78
78
- $ listener = new ExceptionListener ('foo:bar ' );
79
+ $ listener = new ExceptionListener ('foo:bar ' , null , false , class_exists (ErrorListener::class) ? $ this -> prophesize (ErrorListener::class)-> reveal () : null );
79
80
$ listener ->onKernelException ($ eventProphecy ->reveal ());
80
81
}
81
82
}
0 commit comments