From 7d9a1330a5bd3e351efc5ff33107f7e0466c580a Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Wed, 8 May 2019 12:23:22 +0200 Subject: [PATCH] Adjusted option values according to the latest changes --- app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php | 2 +- .../GraphQl/Quote/EditQuoteItemCustomOptionsTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php b/app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php index bc98eb93b55cc..ac9b464eb01b0 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php @@ -47,7 +47,7 @@ public function execute(Quote $cart, int $cartItemId, float $qty, array $customi { $customizableOptions = []; foreach ($customizableOptionsData as $customizableOption) { - $customizableOptions[$customizableOption['id']] = $customizableOption['value']; + $customizableOptions[$customizableOption['id']] = $customizableOption['value_string']; } try { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemCustomOptionsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemCustomOptionsTest.php index 09495f92648be..d3bd10d8ae00e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemCustomOptionsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemCustomOptionsTest.php @@ -168,7 +168,7 @@ public function testOptionSetPersistsOnExtraOptionWithIncorrectId() $customOptionsValues = $this->getCustomOptionsValuesForQuery($sku); /* Add nonexistent option to the query */ - $customOptionsValues[] = ['id' => -10, 'value' => 'value']; + $customOptionsValues[] = ['id' => -10, 'value_string' => 'value']; $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); $customizableOptionsQuery = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', json_encode($customOptionsValues)); @@ -259,13 +259,13 @@ private function getCustomOptionsValuesForQuery(string $sku): array if ($optionType == 'field' || $optionType == 'area') { $customOptionsValues[] = [ 'id' => (int) $customOption->getOptionId(), - 'value' => 'test' + 'value_string' => 'test' ]; } elseif ($optionType == 'drop_down') { $optionSelectValues = $customOption->getValues(); $customOptionsValues[] = [ 'id' => (int) $customOption->getOptionId(), - 'value' => reset($optionSelectValues)->getOptionTypeId() + 'value_string' => reset($optionSelectValues)->getOptionTypeId() ]; } }