From a885e33f6e0737c69b149b6d2ba27f529ffb204e Mon Sep 17 00:00:00 2001 From: mustapayev Date: Tue, 24 Dec 2024 17:37:44 +0100 Subject: [PATCH] style: fix code styles --- tests/Unit/Gateways/GarantiPosTest.php | 31 ++++++++++++------------ tests/Unit/Gateways/InterPosTest.php | 30 ++++++++++++----------- tests/Unit/Gateways/KuveytPosTest.php | 10 ++++---- tests/Unit/Gateways/VakifKatilimTest.php | 2 +- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/tests/Unit/Gateways/GarantiPosTest.php b/tests/Unit/Gateways/GarantiPosTest.php index ec1df7d3..e3883b63 100644 --- a/tests/Unit/Gateways/GarantiPosTest.php +++ b/tests/Unit/Gateways/GarantiPosTest.php @@ -29,7 +29,7 @@ /** * @covers \Mews\Pos\Gateways\GarantiPos - * @covers \Mews\Pos\Gateways\AbstractGateway + * @covers \Mews\Pos\Gateways\AbstractGateway */ class GarantiPosTest extends TestCase { @@ -70,11 +70,11 @@ protected function setUp(): void parent::setUp(); $this->config = [ - 'name' => 'Garanti', - 'class' => GarantiPos::class, - 'gateway_endpoints' => [ - 'payment_api' => 'https://sanalposprovtest.garantibbva.com.tr/VPServlet', - 'gateway_3d' => 'https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine', + 'name' => 'Garanti', + 'class' => GarantiPos::class, + 'gateway_endpoints' => [ + 'payment_api' => 'https://sanalposprovtest.garantibbva.com.tr/VPServlet', + 'gateway_3d' => 'https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine', ], ]; @@ -144,7 +144,8 @@ public function testInit(): void */ public function testGet3DFormData( bool $isWithCard - ): void { + ): void + { $card = $isWithCard ? $this->card : null; $paymentModel = $isWithCard ? PosInterface::MODEL_3D_SECURE : PosInterface::MODEL_3D_HOST; $order = ['id' => '124']; @@ -265,7 +266,7 @@ public function testMake3DPayment( public function testMake3DPaymentHashMismatchException(): void { - $data = GarantiPosResponseDataMapperTest::threeDPaymentDataProvider()['paymentFail1']['threeDResponseData']; + $data = GarantiPosResponseDataMapperTest::threeDPaymentDataProvider()['paymentFail1']['threeDResponseData']; $request = Request::create('', 'POST', $data); $this->cryptMock->expects(self::once()) @@ -309,9 +310,9 @@ public function testMake3DPayPayment(): void ->method('check3DHash'); $responseData = ['$responseData']; - $request = Request::create('', 'POST', $responseData); - $order = ['id' => '123']; - $txType = PosInterface::TX_TYPE_PAY_AUTH; + $request = Request::create('', 'POST', $responseData); + $order = ['id' => '123']; + $txType = PosInterface::TX_TYPE_PAY_AUTH; $this->responseMapperMock->expects(self::once()) ->method('map3DPayResponseData') @@ -569,8 +570,8 @@ public function testOrderHistoryRequest(array $order, string $apiUrl): void */ public function testCustomQueryRequest(array $requestData, ?string $apiUrl, string $expectedApiUrl): void { - $account = $this->pos->getAccount(); - $txType = PosInterface::TX_TYPE_CUSTOM_QUERY; + $account = $this->pos->getAccount(); + $txType = PosInterface::TX_TYPE_CUSTOM_QUERY; $updatedRequestData = $requestData + [ 'abc' => 'def', @@ -617,7 +618,7 @@ public static function customQueryRequestDataProvider(): array public static function make3DPaymentDataProvider(): array { return [ - '3d_auth_fail_1' => [ + '3d_auth_fail_1' => [ 'order' => GarantiPosResponseDataMapperTest::threeDPaymentDataProvider()['3d_auth_fail_1']['order'], 'txType' => GarantiPosResponseDataMapperTest::threeDPaymentDataProvider()['3d_auth_fail_1']['txType'], 'request' => Request::create( @@ -816,7 +817,7 @@ private function configureClientResponse( } ))) ->willReturnCallback(function () use (&$updatedRequestDataPreparedEvent): ?\Mews\Pos\Event\RequestDataPreparedEvent { - $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); + $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); $updatedRequestData['test-update-request-data-with-event'] = true; $updatedRequestDataPreparedEvent->setRequestData($updatedRequestData); diff --git a/tests/Unit/Gateways/InterPosTest.php b/tests/Unit/Gateways/InterPosTest.php index 159bc58c..c4440494 100644 --- a/tests/Unit/Gateways/InterPosTest.php +++ b/tests/Unit/Gateways/InterPosTest.php @@ -72,9 +72,9 @@ protected function setUp(): void parent::setUp(); $this->config = [ - 'name' => 'DenizBank-InterPos', - 'class' => InterPos::class, - 'gateway_endpoints' => [ + 'name' => 'DenizBank-InterPos', + 'class' => InterPos::class, + 'gateway_endpoints' => [ 'payment_api' => 'https://test.inter-vpos.com.tr/mpi/Default.aspx', 'gateway_3d' => 'https://test.inter-vpos.com.tr/mpi/Default.aspx', 'gateway_3d_host' => 'https://test.inter-vpos.com.tr/mpi/3DHost.aspx', @@ -153,7 +153,8 @@ public function testInit(): void */ public function testGet3DFormData( bool $isWithCard - ): void { + ): void + { $card = $isWithCard ? $this->card : null; $paymentModel = $isWithCard ? PosInterface::MODEL_3D_SECURE : PosInterface::MODEL_3D_HOST; $gatewayUrl = $isWithCard ? 'https://test.inter-vpos.com.tr/mpi/Default.aspx' : 'https://test.inter-vpos.com.tr/mpi/3DHost.aspx'; @@ -208,7 +209,8 @@ public function testMake3DPayment( bool $checkHash, bool $is3DSuccess, bool $isSuccess - ): void { + ): void + { if ($checkHash) { $this->cryptMock->expects(self::once()) ->method('check3DHash') @@ -308,9 +310,9 @@ public function testMake3DPayPayment(): void ->method('check3DHash'); $responseData = ['$responseData']; - $request = Request::create('', 'POST', $responseData); - $order = ['id' => '123']; - $txType = PosInterface::TX_TYPE_PAY_AUTH; + $request = Request::create('', 'POST', $responseData); + $order = ['id' => '123']; + $txType = PosInterface::TX_TYPE_PAY_AUTH; $this->responseMapperMock->expects(self::once()) ->method('map3DPayResponseData') @@ -335,9 +337,9 @@ public function testMake3DHostPayment(): void ->method('check3DHash'); $responseData = ['$responseData']; - $request = Request::create('', 'POST', $responseData); - $order = ['id' => '123']; - $txType = PosInterface::TX_TYPE_PAY_AUTH; + $request = Request::create('', 'POST', $responseData); + $order = ['id' => '123']; + $txType = PosInterface::TX_TYPE_PAY_AUTH; $this->responseMapperMock->expects(self::once()) ->method('map3DHostResponseData') @@ -541,8 +543,8 @@ public function testRefundRequest(array $order, string $apiUrl): void */ public function testCustomQueryRequest(array $requestData, ?string $apiUrl, string $expectedApiUrl): void { - $account = $this->pos->getAccount(); - $txType = PosInterface::TX_TYPE_CUSTOM_QUERY; + $account = $this->pos->getAccount(); + $txType = PosInterface::TX_TYPE_CUSTOM_QUERY; $updatedRequestData = $requestData + [ 'abc' => 'def', @@ -758,7 +760,7 @@ private function configureClientResponse( } ))) ->willReturnCallback(function () use (&$updatedRequestDataPreparedEvent): ?\Mews\Pos\Event\RequestDataPreparedEvent { - $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); + $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); $updatedRequestData['test-update-request-data-with-event'] = true; $updatedRequestDataPreparedEvent->setRequestData($updatedRequestData); diff --git a/tests/Unit/Gateways/KuveytPosTest.php b/tests/Unit/Gateways/KuveytPosTest.php index 3e952462..ce0358ab 100644 --- a/tests/Unit/Gateways/KuveytPosTest.php +++ b/tests/Unit/Gateways/KuveytPosTest.php @@ -29,7 +29,7 @@ use Symfony\Component\HttpFoundation\Request; /** - * @covers \Mews\Pos\Gateways\KuveytPos + * @covers \Mews\Pos\Gateways\KuveytPos * @covers \Mews\Pos\Gateways\AbstractGateway */ class KuveytPosTest extends TestCase @@ -284,7 +284,7 @@ public function testMake3DPayment( $create3DPaymentRequestData = [ 'create3DPaymentRequestData', ]; - $encodedRequestData = 'request-body'; + $encodedRequestData = 'request-body'; if ($is3DSuccess) { @@ -318,8 +318,8 @@ public function testMake3DPayment( && $paymentModel === $dispatchedEvent->getPaymentModel(); } ))) - ->willReturnCallback(function() use (&$updatedRequestDataPreparedEvent): ?\Mews\Pos\Event\RequestDataPreparedEvent { - $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); + ->willReturnCallback(function () use (&$updatedRequestDataPreparedEvent): ?\Mews\Pos\Event\RequestDataPreparedEvent { + $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); $updatedRequestData['test-update-request-data-with-event'] = true; $updatedRequestDataPreparedEvent->setRequestData($updatedRequestData); @@ -679,7 +679,7 @@ private function configureClientResponse( } ))) ->willReturnCallback(function () use (&$updatedRequestDataPreparedEvent): ?\Mews\Pos\Event\RequestDataPreparedEvent { - $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); + $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); $updatedRequestData['test-update-request-data-with-event'] = true; $updatedRequestDataPreparedEvent->setRequestData($updatedRequestData); diff --git a/tests/Unit/Gateways/VakifKatilimTest.php b/tests/Unit/Gateways/VakifKatilimTest.php index b5271863..190dcf38 100644 --- a/tests/Unit/Gateways/VakifKatilimTest.php +++ b/tests/Unit/Gateways/VakifKatilimTest.php @@ -994,7 +994,7 @@ private function configureClientResponse( } ))) ->willReturnCallback(function () use (&$updatedRequestDataPreparedEvent): ?\Mews\Pos\Event\RequestDataPreparedEvent { - $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); + $updatedRequestData = $updatedRequestDataPreparedEvent->getRequestData(); $updatedRequestData['test-update-request-data-with-event'] = true; $updatedRequestDataPreparedEvent->setRequestData($updatedRequestData);