Skip to content

Commit 89ba392

Browse files
committed
Fix static tests
1 parent a1f5946 commit 89ba392

File tree

8 files changed

+49
-3
lines changed

8 files changed

+49
-3
lines changed

app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use Magento\Framework\Stdlib\ArrayManager;
1111
use Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestDataProviderInterface;
1212

13+
/**
14+
* DataProvider for building super attribute options in buy requests
15+
*/
1316
class SuperAttributeDataProvider implements BuyRequestDataProviderInterface
1417
{
1518
/**

app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@
1919
*/
2020
class ConfigurableCartItemOptions implements ResolverInterface
2121
{
22+
/**
23+
* @var Configuration
24+
*/
2225
private $configurationHelper;
2326

27+
/**
28+
* @param Configuration $configurationHelper
29+
*/
2430
public function __construct(
2531
Configuration $configurationHelper
2632
) {
@@ -30,7 +36,14 @@ public function __construct(
3036
/**
3137
* Fetch and format configurable variants.
3238
*
33-
* {@inheritdoc}
39+
* @param Field $field
40+
* @param \Magento\Framework\GraphQl\Query\Resolver\ContextInterface $context
41+
* @param ResolveInfo $info
42+
* @param array|null $value
43+
* @param array|null $args
44+
* @return array|\Magento\Framework\GraphQl\Query\Resolver\Value|mixed
45+
* @throws LocalizedException
46+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3447
*/
3548
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
3649
{

app/code/Magento/ConfigurableProductGraphQl/composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"magento/module-catalog": "*",
88
"magento/module-configurable-product": "*",
99
"magento/module-catalog-graph-ql": "*",
10+
"magento/module-quote": "*",
11+
"magento/module-quote-graph-ql": "*",
1012
"magento/framework": "*"
1113
},
1214
"license": [

app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use Magento\Framework\DataObject;
1111
use Magento\Framework\DataObjectFactory;
1212

13+
/**
14+
* Build buy request for adding products to cart
15+
*/
1316
class BuyRequestBuilder
1417
{
1518
/**
@@ -22,6 +25,10 @@ class BuyRequestBuilder
2225
*/
2326
private $dataObjectFactory;
2427

28+
/**
29+
* @param DataObjectFactory $dataObjectFactory
30+
* @param array $providers
31+
*/
2532
public function __construct(
2633
DataObjectFactory $dataObjectFactory,
2734
array $providers = []
@@ -30,6 +37,12 @@ public function __construct(
3037
$this->providers = $providers;
3138
}
3239

40+
/**
41+
* Build buy request for adding product to cart
42+
*
43+
* @param array $cartItemData
44+
* @return DataObject
45+
*/
3346
public function build(array $cartItemData): DataObject
3447
{
3548
$requestData = [];

app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77

88
namespace Magento\QuoteGraphQl\Model\Cart\BuyRequest;
99

10+
/**
11+
* Build buy request for adding products to cart
12+
*/
1013
interface BuyRequestDataProviderInterface
1114
{
15+
/**
16+
* Build buy request for adding product to cart
17+
*
18+
* @param array $cartItemData
19+
* @return DataObject
20+
*/
1221
public function execute(array $cartItemData): array;
1322
}

app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
use Magento\Framework\Stdlib\ArrayManager;
1111

12+
/**
13+
* Extract buy request elements require for custom options
14+
*/
1215
class CustomizableOptionsDataProvider implements BuyRequestDataProviderInterface
1316
{
1417
/**

app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/QuantityDataProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1111
use Magento\Framework\Stdlib\ArrayManager;
1212

13+
/**
14+
* Provides QTY buy request data for adding products to cart
15+
*/
1316
class QuantityDataProvider implements BuyRequestDataProviderInterface
1417
{
1518
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testAddProductWithInvalidOptions()
9090
1
9191
);
9292

93-
$response = $this->graphQlMutation($query);
93+
$this->graphQlMutation($query);
9494
}
9595

9696
/**
@@ -117,7 +117,7 @@ public function testAddProductIfQuantityIsNotAvailable()
117117
2000
118118
);
119119

120-
$response = $this->graphQlMutation($query);
120+
$this->graphQlMutation($query);
121121
}
122122

123123
/**

0 commit comments

Comments
 (0)