diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartAddressTypeResolver.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartAddressTypeResolver.php index 14c1dc76590a..6f7c70b09cb0 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartAddressTypeResolver.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartAddressTypeResolver.php @@ -20,7 +20,7 @@ class CartAddressTypeResolver implements TypeResolverInterface /** * @inheritdoc */ - public function resolveType(array $data) : string + public function resolveType(array $data): string { if (!isset($data['model'])) { throw new LocalizedException(__('Missing key "model" in cart address data')); @@ -33,7 +33,7 @@ public function resolveType(array $data) : string } elseif ($address->getAddressType() == AbstractAddress::TYPE_BILLING) { $addressType = 'BillingCartAddress'; } else { - throw new LocalizedException( __('Unsupported cart address type')); + throw new LocalizedException(__('Unsupported cart address type')); } return $addressType; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php index 1633c83895e6..6f27693eeb4a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php @@ -71,13 +71,13 @@ public function testAddMoreProductsThatAllowed() * @expectedException \Exception * @expectedExceptionMessage Please enter a number greater than 0 in this field. */ - public function testAddSimpleProductToCartWithNegativeQty() + public function testAddSimpleProductToCartWithNegativeQuantity() { $sku = 'simple'; - $qty = -2; + $quantity = -2; $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); - $query = $this->getQuery($maskedQuoteId, $sku, $qty); + $query = $this->getQuery($maskedQuoteId, $sku, $quantity); $this->graphQlMutation($query); } @@ -88,10 +88,10 @@ public function testAddSimpleProductToCartWithNegativeQty() public function testAddProductIfQuantityIsDecimal() { $sku = 'simple_product'; - $qty = 0.2; + $quantity = 0.2; $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); - $query = $this->getQuery($maskedQuoteId, $sku, $qty); + $query = $this->getQuery($maskedQuoteId, $sku, $quantity); $this->expectExceptionMessage( "Could not add the product with SKU {$sku} to the shopping cart: The fewest you may purchase is 1" @@ -102,10 +102,10 @@ public function testAddProductIfQuantityIsDecimal() /** * @param string $maskedQuoteId * @param string $sku - * @param float $qty + * @param float $quantity * @return string */ - private function getQuery(string $maskedQuoteId, string $sku, float $qty) : string + private function getQuery(string $maskedQuoteId, string $sku, float $quantity) : string { return <<getMaskedQuoteIdByReservedOrderId->execute('test_quote'); $itemId = $this->getQuoteItemIdByReservedQuoteIdAndSku->execute('test_quote', 'simple_product'); - $qty = 0.5; + $quantity = 0.5; $this->expectExceptionMessage( "Could not update the product with SKU simple_product: The fewest you may purchase is 1" ); - $query = $this->getQuery($maskedQuoteId, $itemId, $qty); + $query = $this->getQuery($maskedQuoteId, $itemId, $quantity); $this->graphQlMutation($query); } /** * @param string $maskedQuoteId * @param int $itemId - * @param float $qty + * @param float $quantity * @return string */ - private function getQuery(string $maskedQuoteId, int $itemId, float $qty): string + private function getQuery(string $maskedQuoteId, int $itemId, float $quantity): string { return << null, ], 'telephone' => null, - '__typename' => 'BillingCartAddress', + '__typename' => null, ]; self::assertEquals($expectedBillingAddressData, $response['cart']['billing_address']); }