Skip to content

Commit

Permalink
magento#761: [Customizable Options] Call to a member function format(…
Browse files Browse the repository at this point in the history
…) on boolean
  • Loading branch information
lenaorobei committed Oct 14, 2019
1 parent 0809b69 commit d2039f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

/**
* CatalogGraphQl product option date type
*
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class DateType extends ProductDateOptionType
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public function testAddSimpleProductWithOptions()
$customOptionsValues = $this->getCustomOptionsValuesForQueryBySku->execute($sku);
/* Generate customizable options fragment for GraphQl request */
$queryCustomizableOptionValues = preg_replace(
'/"([^"]+)"\s*:\s*/', '$1:',
'/"([^"]+)"\s*:\s*/',
'$1:',
json_encode(array_values($customOptionsValues))
);

Expand Down Expand Up @@ -118,7 +119,8 @@ public function testAddSimpleProductWithWrongDateOptionFormat()
$customOptionsValues = $this->getCustomOptionsValuesForQueryBySku->execute($sku);
$customOptionsValues['date']['value_string'] = '12-12-12';
$queryCustomizableOptionValues = preg_replace(
'/"([^"]+)"\s*:\s*/', '$1:',
'/"([^"]+)"\s*:\s*/',
'$1:',
json_encode(array_values($customOptionsValues))
);
$customizableOptions = "customizable_options: {$queryCustomizableOptionValues}";
Expand Down

0 comments on commit d2039f2

Please sign in to comment.