Skip to content

Commit 936830f

Browse files
committed
MC-16922: Create an end-to-end test SetPaymentMethodOnCart for the authorize.net payment method
1 parent 0784da7 commit 936830f

File tree

4 files changed

+2
-273
lines changed

4 files changed

+2
-273
lines changed

dev/tests/integration/testsuite/Magento/AuthorizenetGraphQl/Model/Resolver/Customer/PlaceOrderWithAuthorizeNetTest.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use Magento\GraphQl\Controller\GraphQl;
1313
use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
1414
use Magento\Integration\Api\CustomerTokenServiceInterface;
15-
use Magento\Payment\Gateway\Command\CommandPoolInterface;
16-
use Magento\Sales\Model\Order;
1715
use Magento\Framework\Webapi\Request;
1816
use Magento\TestFramework\Helper\Bootstrap;
1917
use Magento\Framework\HTTP\ZendClient;
@@ -92,6 +90,7 @@ protected function setUp() : void
9290
* @magentoConfigFixture default_store payment/authorizenet_acceptjs/login someusername
9391
* @magentoConfigFixture default_store payment/authorizenet_acceptjs/trans_key somepassword
9492
* @magentoConfigFixture default_store payment/authorizenet_acceptjs/trans_signature_key abc
93+
* @magentoDataFixture Magento/Sales/_files/default_rollback.php
9594
* @magentoDataFixture Magento/Customer/_files/customer.php
9695
* @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product_authorizenet.php
9796
* @magentoDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
@@ -150,15 +149,6 @@ public function testDispatchToPlaceOrderWithRegisteredCustomer(): void
150149

151150
$graphql = $this->objectManager->get(\Magento\GraphQl\Controller\GraphQl::class);
152151

153-
/** @var CommandPoolInterface $commandPool */
154-
$commandPool = $this->objectManager->get('AuthorizenetAcceptjsCommandPool');
155-
$commandPool->get('authorize');
156-
/** @var Order $order */
157-
$fullOrder = include __DIR__ . '/../../../_files/place_order_customer_authorizenet.php';
158-
159-
$payment = $fullOrder->getPayment();
160-
$this->paymentFactory->create($payment);
161-
162152
$expectedRequest = include __DIR__ . '/../../../_files/request_authorize_customer.php';
163153
$authorizeResponse = include __DIR__ . '/../../../_files/response_authorize.php';
164154

dev/tests/integration/testsuite/Magento/AuthorizenetGraphQl/Model/Resolver/Guest/PlaceOrderWithAuthorizeNetTest.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
use Magento\Framework\Serialize\SerializerInterface;
1212
use Magento\GraphQl\Controller\GraphQl;
1313
use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
14-
use Magento\Payment\Gateway\Command\CommandPoolInterface;
15-
use Magento\Sales\Model\Order;
1614
use Magento\TestFramework\Helper\Bootstrap;
1715
use Magento\Framework\HTTP\ZendClient;
1816
use Magento\Framework\HTTP\ZendClientFactory;
@@ -86,6 +84,7 @@ protected function setUp() : void
8684
* @magentoConfigFixture default_store payment/authorizenet_acceptjs/login someusername
8785
* @magentoConfigFixture default_store payment/authorizenet_acceptjs/trans_key somepassword
8886
* @magentoConfigFixture default_store payment/authorizenet_acceptjs/trans_signature_key abc
87+
* @magentoDataFixture Magento/Sales/_files/default_rollback.php
8988
* @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product_authorizenet.php
9089
* @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
9190
* @magentoDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
@@ -137,15 +136,6 @@ public function testDispatchToPlaceAnOrderWithAuthorizenet(): void
137136
->addHeaders(['Content-Type' => 'application/json']);
138137
$this->request->setHeaders($headers);
139138

140-
/** @var CommandPoolInterface $commandPool */
141-
$commandPool = $this->objectManager->get('AuthorizenetAcceptjsCommandPool');
142-
$command = $commandPool->get('authorize');
143-
/** @var Order $order */
144-
$fullOrder = include __DIR__ . '/../../../_files/place_order_guest_authorizenet.php';
145-
146-
$payment = $fullOrder->getPayment();
147-
$paymentDO = $this->paymentFactory->create($payment);
148-
149139
$expectedRequest = include __DIR__ . '/../../../_files/request_authorize.php';
150140
$authorizeResponse = include __DIR__ . '/../../../_files/response_authorize.php';
151141

@@ -154,11 +144,6 @@ public function testDispatchToPlaceAnOrderWithAuthorizenet(): void
154144

155145
$this->responseMock->method('getBody')->willReturn(json_encode($authorizeResponse));
156146

157-
$command->execute([
158-
'payment' => $paymentDO,
159-
'amount' => 100.00
160-
]);
161-
162147
$response = $this->graphql->dispatch($this->request);
163148
$responseData = $this->jsonSerializer->unserialize($response->getContent());
164149

dev/tests/integration/testsuite/Magento/AuthorizenetGraphQl/_files/place_order_customer_authorizenet.php

Lines changed: 0 additions & 123 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/AuthorizenetGraphQl/_files/place_order_guest_authorizenet.php

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)