Skip to content

Commit facce4c

Browse files
committed
magento/graphql-ce#761: [Customizable Options] Call to a member function format() on boolean
1 parent d2039f2 commit facce4c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ public function testAddDownloadableProductWithOptions()
5858

5959
$customOptionsValues = $this->getCustomOptionsValuesForQueryBySku->execute($sku);
6060
/* Generate customizable options fragment for GraphQl request */
61-
$queryCustomizableOptionValues = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', json_encode($customOptionsValues));
61+
$queryCustomizableOptionValues = preg_replace(
62+
'/"([^"]+)"\s*:\s*/',
63+
'$1:',
64+
json_encode(array_values($customOptionsValues))
65+
);
6266
$customizableOptions = "customizable_options: {$queryCustomizableOptionValues}";
6367

6468
$query = $this->getQuery($maskedQuoteId, $qty, $sku, $customizableOptions, $linkId);

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public function testAddVirtualProductWithOptions()
5757

5858
$customOptionsValues = $this->getCustomOptionsValuesForQueryBySku->execute($sku);
5959
/* Generate customizable options fragment for GraphQl request */
60-
$queryCustomizableOptionValues = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', json_encode($customOptionsValues));
60+
$queryCustomizableOptionValues = preg_replace(
61+
'/"([^"]+)"\s*:\s*/',
62+
'$1:',
63+
json_encode(array_values($customOptionsValues))
64+
);
6165

6266
$customizableOptions = "customizable_options: {$queryCustomizableOptionValues}";
6367
$query = $this->getQuery($maskedQuoteId, $sku, $quantity, $customizableOptions);

0 commit comments

Comments
 (0)