Skip to content

Commit be4c355

Browse files
ACQE-8324: Using rest api update guest cart of configurable product
- Updated coding standards in variable declaration and return statements
1 parent f08d839 commit be4c355

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartConfigurableItemRepositoryTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class GuestCartConfigurableItemRepositoryTest extends WebapiAbstract
4343
/**
4444
* @var array
4545
*/
46-
private $simpleProductSkus=[];
46+
private $simpleProductSkus = [];
4747

4848
/**
4949
* @var DataFixtureStorage
@@ -60,7 +60,7 @@ protected function setUp(): void
6060
}
6161

6262
/**
63-
* Test guest cart update configurable item using modern fixtures
63+
* Test guest cart update with configurable item
6464
*/
6565
#[
6666
DataFixture(ProductFixture::class, ['price' => 10, 'sku' => 'simple-10'], as: 'p1'),
@@ -92,7 +92,8 @@ public function testGuestCartUpdateConfigurableItem()
9292
*/
9393
private function createGuestCart(): string
9494
{
95-
$serviceInfo = [
95+
$requestData = ['storeId' => 1];
96+
$quoteId = $this->_webApiCall([
9697
'rest' => [
9798
'resourcePath' => self::RESOURCE_PATH_GUEST_CART,
9899
'httpMethod' => Request::HTTP_METHOD_POST
@@ -102,11 +103,9 @@ private function createGuestCart(): string
102103
'serviceVersion' => self::SERVICE_VERSION_GUEST_CART,
103104
'operation' => self::SERVICE_NAME_GUEST_CART . 'CreateEmptyCart',
104105
],
105-
];
106-
107-
$requestData = ['storeId' => 1];
108-
$quoteId = $this->_webApiCall($serviceInfo, $requestData);
106+
], $requestData);
109107
$this->assertTrue(strlen($quoteId) >= 32);
108+
110109
return $quoteId;
111110
}
112111

@@ -140,6 +139,7 @@ private function addConfigurableProductToCart(string $guestCartId): array
140139
$response['product_option']['extension_attributes']['configurable_item_options'][0],
141140
$requestData['cartItem']['product_option']['extension_attributes']['configurable_item_options'][0]
142141
);
142+
143143
return $response;
144144
}
145145

@@ -219,6 +219,7 @@ private function getConfigurableProduct(): ProductInterface
219219
foreach ($simpleProducts as $simpleProduct) {
220220
$this->simpleProductSkus[] = $simpleProduct->getSku();
221221
}
222+
222223
return $configurableProduct;
223224
}
224225

0 commit comments

Comments
 (0)