File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
tests/Bridge/Symfony/Validator/EventListener Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,11 @@ class ValidationExceptionListenerTest extends TestCase
3131 public function testNotValidationException ()
3232 {
3333 $ eventProphecy = $ this ->prophesize (ExceptionEvent::class);
34- $ eventProphecy ->getException ()->willReturn (new \Exception ())->shouldBeCalled ();
34+ if (method_exists (ExceptionEvent::class, 'getException ' )){
35+ $ eventProphecy ->getException ()->willReturn (new \Exception ())->shouldBeCalled ();
36+ }else {
37+ $ eventProphecy ->getThrowable ()->willReturn (new \Exception ())->shouldBeCalled ();
38+ }
3539 $ eventProphecy ->setResponse ()->shouldNotBeCalled ();
3640
3741 $ serializerProphecy = $ this ->prophesize (SerializerInterface::class);
@@ -46,7 +50,11 @@ public function testValidationException()
4650 $ list = new ConstraintViolationList ([]);
4751
4852 $ eventProphecy = $ this ->prophesize (ExceptionEvent::class);
49- $ eventProphecy ->getException ()->willReturn (new ValidationException ($ list ))->shouldBeCalled ();
53+ if (method_exists (ExceptionEvent::class, 'getException ' )){
54+ $ eventProphecy ->getException ()->willReturn (new ValidationException ($ list ))->shouldBeCalled ();
55+ }else {
56+ $ eventProphecy ->getThrowable ()->willReturn (new ValidationException ($ list ))->shouldBeCalled ();
57+ }
5058 $ eventProphecy ->getRequest ()->willReturn (new Request ())->shouldBeCalled ();
5159 $ eventProphecy ->setResponse (Argument::allOf (
5260 Argument::type (Response::class),
You can’t perform that action at this time.
0 commit comments