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
31
31
public function testNotValidationException ()
32
32
{
33
33
$ 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
+ }
35
39
$ eventProphecy ->setResponse ()->shouldNotBeCalled ();
36
40
37
41
$ serializerProphecy = $ this ->prophesize (SerializerInterface::class);
@@ -46,7 +50,11 @@ public function testValidationException()
46
50
$ list = new ConstraintViolationList ([]);
47
51
48
52
$ 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
+ }
50
58
$ eventProphecy ->getRequest ()->willReturn (new Request ())->shouldBeCalled ();
51
59
$ eventProphecy ->setResponse (Argument::allOf (
52
60
Argument::type (Response::class),
You can’t perform that action at this time.
0 commit comments