Skip to content

Commit 6c76ec5

Browse files
author
Szymon Kostrubiec
committed
OP-283 - Apply ECS fixes
1 parent e08c954 commit 6c76ec5

5 files changed

Lines changed: 42 additions & 45 deletions

File tree

tests/spec/Action/CaptureActionSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class CaptureActionSpec extends ObjectBehavior
3030
{
3131
function let(
3232
OpenPayUBridgeInterface $openPayUBridge,
33-
PaymentDescriptionProviderInterface $paymentDescriptionProvider
33+
PaymentDescriptionProviderInterface $paymentDescriptionProvider,
3434
): void {
3535
$this->beConstructedWith($openPayUBridge, $paymentDescriptionProvider);
3636
}
@@ -48,7 +48,7 @@ function it_executes(
4848
OrderInterface $order,
4949
CustomerInterface $customer,
5050
TokenInterface $token,
51-
GatewayInterface $gateway
51+
GatewayInterface $gateway,
5252
): void {
5353
$model->getIterator()->willReturn($iterator);
5454
$model->offsetSet('customer', $customer)->willReturn(null);

tests/spec/Action/ConvertPaymentActionSpec.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function it_implements_action_interface(): void
3636
function it_executes(
3737
Convert $request,
3838
PaymentInterface $payment,
39-
OrderInterface $order
39+
OrderInterface $order,
4040
): void {
4141
$payment->getDetails()->willReturn([]);
4242
$payment->getTotalAmount()->willReturn(88000);
@@ -70,8 +70,8 @@ static function ($values) use ($details): bool {
7070
}
7171

7272
return true;
73-
}
74-
)
73+
},
74+
),
7575
)->shouldBeCalled();
7676

7777
$this->execute($request);

tests/spec/Action/NotifyActionSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function it_executes(
3939
TokenInterface $token,
4040
ArrayObject $model,
4141
GetHumanStatus $status,
42-
GatewayInterface $gateway
42+
GatewayInterface $gateway,
4343
): void {
4444
$request->getToken()->willReturn($token);
4545
$request->getModel()->willReturn($model);

tests/spec/Action/StatusActionSpec.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class StatusActionSpec extends ObjectBehavior
2626
function it_marks_as_new_when_status_is_new(
2727
GetStatus $request,
2828
ArrayObject $model,
29-
Iterator $iterator
29+
Iterator $iterator,
3030
): void {
3131
$model->getIterator()->willReturn($iterator);
3232
$model->offsetExists('orderId')->willReturn(true);
@@ -44,7 +44,7 @@ function it_marks_as_new_when_status_is_new(
4444
function it_marks_as_pending_when_status_form_api_is_pending(
4545
GetStatus $request,
4646
ArrayObject $model,
47-
Iterator $iterator
47+
Iterator $iterator,
4848
): void {
4949
$model->getIterator()->willReturn($iterator);
5050
$model->offsetExists('orderId')->willReturn(true);
@@ -62,7 +62,7 @@ function it_marks_as_pending_when_status_form_api_is_pending(
6262
function it_marks_as_canceled_when_status_form_api_is_canceled(
6363
GetStatus $request,
6464
ArrayObject $model,
65-
Iterator $iterator
65+
Iterator $iterator,
6666
): void {
6767
$model->getIterator()->willReturn($iterator);
6868
$model->offsetExists('orderId')->willReturn(true);
@@ -80,7 +80,7 @@ function it_marks_as_canceled_when_status_form_api_is_canceled(
8080
function it_marks_as_waiting_when_status_form_api_is_waiting_for_confirmation(
8181
GetStatus $request,
8282
ArrayObject $model,
83-
Iterator $iterator
83+
Iterator $iterator,
8484
): void {
8585
$model->getIterator()->willReturn($iterator);
8686
$model->offsetExists('orderId')->willReturn(true);
@@ -98,7 +98,7 @@ function it_marks_as_waiting_when_status_form_api_is_waiting_for_confirmation(
9898
function it_marks_as_completed_when_status_form_api_is_completed(
9999
GetStatus $request,
100100
ArrayObject $model,
101-
Iterator $iterator
101+
Iterator $iterator,
102102
): void {
103103
$model->getIterator()->willReturn($iterator);
104104
$model->offsetExists('orderId')->willReturn(true);

tests/spec/EventListener/PayUResponseExceptionEventListenerSpec.php

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
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!
@@ -15,20 +17,19 @@
1517
use Symfony\Component\HttpFoundation\RedirectResponse;
1618
use Symfony\Component\HttpFoundation\Request;
1719
use Symfony\Component\HttpFoundation\RequestStack;
18-
use Symfony\Component\HttpFoundation\Session\Session;
1920
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
21+
use Symfony\Component\HttpFoundation\Session\Session;
22+
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
2023
use Symfony\Component\HttpKernel\HttpKernelInterface;
2124
use Symfony\Component\Routing\RouterInterface;
22-
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
2325

2426
final 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

Comments
 (0)