Skip to content

Commit 467d115

Browse files
committed
MC-17592: End-to-end integration to test order with Payflow Link
- review comments and static failure fix
1 parent 57258eb commit 467d115

File tree

4 files changed

+13
-23
lines changed

4 files changed

+13
-23
lines changed

dev/tests/integration/testsuite/Magento/Paypal/_files/order_payflow_link_with_payment.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
include __DIR__ . '/../../GraphQl/Quote/_files/set_new_billing_address.php';
1212
include __DIR__ . '/../../GraphQl/Quote/_files/set_flatrate_shipping_method.php';
1313

14-
1514
use Magento\Paypal\Model\Config;
1615
use Magento\Quote\Api\CartRepositoryInterface;
1716
use Magento\Sales\Api\Data\OrderInterface;
@@ -51,7 +50,6 @@
5150
->setBaseAmountAuthorized(30)
5251
->setAdditionalInformation(
5352
[
54-
5553
'cancel_url'=> $baseUrl .'paypal/payflow/cancelPayment',
5654
'return_url'=> $baseUrl .'paypal/payflow/returnUrl',
5755
'secure_token_id' => 'mysecuretokenId',

dev/tests/integration/testsuite/Magento/Paypal/_files/order_payflow_link_with_payment_rollback.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,5 @@
1616
foreach ($orderCollection as $order) {
1717
$order->delete();
1818
}
19-
20-
/** @var $product \Magento\Catalog\Model\Product */
21-
$productCollection = Bootstrap::getObjectManager()->create(
22-
\Magento\Catalog\Model\ResourceModel\Product\Collection::class
23-
);
24-
foreach ($productCollection as $product) {
25-
$product->delete();
26-
}
27-
28-
/** @var \Magento\CatalogInventory\Model\StockRegistryStorage $stockRegistryStorage */
29-
$stockRegistryStorage = Bootstrap::getObjectManager()
30-
->get(\Magento\CatalogInventory\Model\StockRegistryStorage::class);
31-
$stockRegistryStorage->clean();
32-
3319
$registry->unregister('isSecureArea');
3420
$registry->register('isSecureArea', false);

dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PlaceOrderWithPayflowLinkTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function testResolvePlaceOrderWithPayflowLinkForCustomer(): void
154154
$this->request->setPathInfo('/graphql');
155155
$this->request->setMethod('POST');
156156
$this->request->setContent($postData);
157-
157+
158158
/** @var \Magento\Integration\Model\Oauth\Token $tokenModel */
159159
$tokenModel = $this->objectManager->create(\Magento\Integration\Model\Oauth\Token::class);
160160
$customerToken = $tokenModel->createCustomerToken(1)->getToken();

dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Guest/PlaceOrderWithPayflowLinkTest.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class PlaceOrderWithPayflowLinkTest extends TestCase
5757
/** @var Request|MockObject */
5858
private $payflowRequest;
5959

60-
6160
protected function setUp()
6261
{
6362
parent::setUp();
@@ -284,16 +283,23 @@ public function testResolveWithPayflowLinkDeclined(): void
284283
);
285284
$this->gateway->method('postRequest')
286285
/** @var DataObject $linkRequest */
287-
->with(self::callback(function ($linkRequest) {
288-
self::assertEquals('test_quote', $linkRequest['invnum']);
289-
return true;
290-
}))->willThrowException($exception);
286+
->with(
287+
self::callback(
288+
function ($linkRequest) {
289+
self::assertEquals('test_quote', $linkRequest['invnum']);
290+
return true;
291+
}
292+
)
293+
)->willThrowException($exception);
291294

292295
$response = $this->graphqlController->dispatch($this->request);
293296
$responseData = $this->json->unserialize($response->getContent());
294297
$this->assertArrayHasKey('errors', $responseData);
295298
$actualError = $responseData['errors'][0];
296-
$this->assertEquals('Unable to place order: Declined response message from PayPal gateway', $actualError['message']);
299+
$this->assertEquals(
300+
'Unable to place order: Declined response message from PayPal gateway',
301+
$actualError['message']
302+
);
297303
$this->assertEquals(GraphQlInputException::EXCEPTION_CATEGORY, $actualError['category']);
298304
}
299305

0 commit comments

Comments
 (0)