Skip to content

Commit e24a4c8

Browse files
committed
GraphQL-420: Test coverage: GetAvailablePaymentMethodsTest for Guest
1 parent 2bd07f7 commit e24a4c8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ protected function setUp()
4747
/**
4848
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
4949
*/
50-
public function testGetPaymentMethodsFromGuestCart()
50+
public function testGetCartWithPaymentMethods()
5151
{
5252
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId('test_order_with_simple_product_without_address');
53-
$query = $this->getCartAvailablePaymentMethodsQuery($maskedQuoteId);
54-
$response = $this->graphQlQuery($query);
53+
$query = $this->getQuery($maskedQuoteId);
54+
$response = $this->graphQlQuery($query);
5555

5656
self::assertArrayHasKey('cart', $response);
5757

@@ -73,10 +73,10 @@ public function testGetPaymentMethodsFromGuestCart()
7373
/**
7474
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
7575
*/
76-
public function testGetPaymentMethodsFromAnotherCustomerCart()
76+
public function testGetPaymentMethodsFromCustomerCart()
7777
{
7878
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId('test_order_1');
79-
$query = $this->getCartAvailablePaymentMethodsQuery($maskedQuoteId);
79+
$query = $this->getQuery($maskedQuoteId);
8080

8181
$this->expectExceptionMessage(
8282
"The current user cannot perform operations on cart \"$maskedQuoteId\""
@@ -91,8 +91,8 @@ public function testGetPaymentMethodsFromAnotherCustomerCart()
9191
public function testGetPaymentMethodsIfPaymentsAreNotSet()
9292
{
9393
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId('test_order_with_simple_product_without_address');
94-
$query = $this->getCartAvailablePaymentMethodsQuery($maskedQuoteId);
95-
$response = $this->graphQlQuery($query);
94+
$query = $this->getQuery($maskedQuoteId);
95+
$response = $this->graphQlQuery($query);
9696

9797
self::assertEquals(0, count($response['cart']['available_payment_methods']));
9898
}
@@ -104,17 +104,17 @@ public function testGetPaymentMethodsIfPaymentsAreNotSet()
104104
public function testGetPaymentMethodsOfNonExistentCart()
105105
{
106106
$maskedQuoteId = 'non_existent_masked_id';
107-
$query = $this->getCartAvailablePaymentMethodsQuery($maskedQuoteId);
107+
$query = $this->getQuery($maskedQuoteId);
108108
$this->graphQlQuery($query);
109109
}
110110

111111
/**
112112
* @param string $maskedQuoteId
113113
* @return string
114114
*/
115-
private function getCartAvailablePaymentMethodsQuery(
115+
private function getQuery(
116116
string $maskedQuoteId
117-
) : string {
117+
): string {
118118
return <<<QUERY
119119
{
120120
cart(cart_id: "$maskedQuoteId") {

0 commit comments

Comments
 (0)