11<?php
22
3+ declare (strict_types=1 );
4+
35/*
46 * This file was created by developers working at BitBag
57 * Do you need more information about us and what we do? Visit our https://bitbag.io website!
1517use Symfony \Component \HttpFoundation \RedirectResponse ;
1618use Symfony \Component \HttpFoundation \Request ;
1719use Symfony \Component \HttpFoundation \RequestStack ;
18- use Symfony \Component \HttpFoundation \Session \Session ;
1920use Symfony \Component \HttpFoundation \Session \Flash \FlashBagInterface ;
21+ use Symfony \Component \HttpFoundation \Session \Session ;
22+ use Symfony \Component \HttpKernel \Event \ExceptionEvent ;
2023use Symfony \Component \HttpKernel \HttpKernelInterface ;
2124use Symfony \Component \Routing \RouterInterface ;
22- use Symfony \Component \HttpKernel \Event \ExceptionEvent ;
2325
2426final class PayUResponseExceptionEventListenerSpec extends ObjectBehavior
2527{
2628 public function let (
2729 RouterInterface $ router ,
28- RequestStack $ requestStack ,
29- LoggerInterface $ logger
30- ): void
31- {
30+ RequestStack $ requestStack ,
31+ LoggerInterface $ logger ,
32+ ): void {
3233 $ this ->beConstructedWith ($ router , $ requestStack , $ logger );
3334 }
3435
@@ -38,21 +39,20 @@ public function it_is_initializable(): void
3839 }
3940
4041 public function it_should_redirect_to_order_payment_page_if_token_value_is_set (
41- RequestStack $ requestStack ,
42- Session $ session ,
43- FlashBagInterface $ flashBag ,
44- RouterInterface $ router ,
42+ RequestStack $ requestStack ,
43+ Session $ session ,
44+ FlashBagInterface $ flashBag ,
45+ RouterInterface $ router ,
4546 HttpKernelInterface $ kernel ,
46- RedirectResponse $ response ,
47- ): void
48- {
47+ RedirectResponse $ response ,
48+ ): void {
4949 $ order = ['tokenValue ' => 'D8gHAy3dpj12x ' ];
50- $ exception = new PayUResponseException (" ERROR_INCONSISTENT_CURRENCIES " , 500 , $ order );
50+ $ exception = new PayUResponseException (' ERROR_INCONSISTENT_CURRENCIES ' , 500 , $ order );
5151 $ event = new ExceptionEvent (
5252 $ kernel ->getWrappedObject (),
5353 new Request (),
5454 500 ,
55- $ exception
55+ $ exception,
5656 );
5757
5858 $ requestStack ->getSession ()->willReturn ($ session );
@@ -68,21 +68,20 @@ public function it_should_redirect_to_order_payment_page_if_token_value_is_set(
6868 }
6969
7070 public function it_should_redirect_to_empty_cart_page_if_token_value_is_not_set (
71- RequestStack $ requestStack ,
72- Session $ session ,
73- FlashBagInterface $ flashBag ,
74- RouterInterface $ router ,
71+ RequestStack $ requestStack ,
72+ Session $ session ,
73+ FlashBagInterface $ flashBag ,
74+ RouterInterface $ router ,
7575 HttpKernelInterface $ kernel ,
76- RedirectResponse $ response ,
77- ): void
78- {
76+ RedirectResponse $ response ,
77+ ): void {
7978 $ order = [];
80- $ exception = new PayUResponseException (" ERROR_INCONSISTENT_CURRENCIES " , 500 , $ order );
79+ $ exception = new PayUResponseException (' ERROR_INCONSISTENT_CURRENCIES ' , 500 , $ order );
8180 $ event = new ExceptionEvent (
8281 $ kernel ->getWrappedObject (),
8382 new Request (),
8483 500 ,
85- $ exception
84+ $ exception,
8685 );
8786
8887 $ requestStack ->getSession ()->willReturn ($ session );
@@ -97,21 +96,20 @@ public function it_should_redirect_to_empty_cart_page_if_token_value_is_not_set(
9796 }
9897
9998 public function it_should_redirect_to_empty_cart_page_if_token_value_is_not_set_and_currency_is_correct (
100- RequestStack $ requestStack ,
101- Session $ session ,
102- FlashBagInterface $ flashBag ,
103- RouterInterface $ router ,
99+ RequestStack $ requestStack ,
100+ Session $ session ,
101+ FlashBagInterface $ flashBag ,
102+ RouterInterface $ router ,
104103 HttpKernelInterface $ kernel ,
105- RedirectResponse $ response ,
106- ): void
107- {
104+ RedirectResponse $ response ,
105+ ): void {
108106 $ order = [];
109- $ exception = new PayUResponseException (" SOME_ERROR " , 500 , $ order );
107+ $ exception = new PayUResponseException (' SOME_ERROR ' , 500 , $ order );
110108 $ event = new ExceptionEvent (
111109 $ kernel ->getWrappedObject (),
112110 new Request (),
113111 500 ,
114- $ exception
112+ $ exception,
115113 );
116114
117115 $ requestStack ->getSession ()->willReturn ($ session );
@@ -125,7 +123,6 @@ public function it_should_redirect_to_empty_cart_page_if_token_value_is_not_set_
125123 $ this ->onPayuOpenException ($ event );
126124 }
127125
128-
129126 public function it_logs_errors (LoggerInterface $ logger ): void
130127 {
131128 $ exception = new \Exception ('An error occurred ' );
0 commit comments