/**
  * Prepares fixture data for comparison
  *
  * @param array $data
  * @param array $sortFields [optional]
  * @return array
  */
 protected function prepareFixtureData(array $data, array $sortFields = [])
 {
     // Attribute is no longer displayed on product page
     unset($data['configurable_attributes_data']['attributes_data']);
     // prepare and filter values, reset keys in variation matrix
     $variationsMatrix = $data['configurable_attributes_data']['matrix'];
     foreach ($variationsMatrix as $key => $variationMatrix) {
         $variationsMatrix[$key] = array_diff_key($variationMatrix, array_flip($this->skippedVariationMatrixFields));
     }
     $data['configurable_attributes_data']['matrix'] = array_values($variationsMatrix);
     return parent::prepareFixtureData($data, $sortFields);
 }
 /**
  * Prepares fixture data for comparison
  *
  * @param array $data
  * @param array $sortFields [optional]
  * @return array
  */
 protected function prepareFixtureData(array $data, array $sortFields = [])
 {
     // filter values and reset keys in attributes data
     $attributeData = $data['configurable_attributes_data']['attributes_data'];
     foreach ($attributeData as $attributeKey => $attribute) {
         foreach ($attribute['options'] as $optionKey => $option) {
             $attribute['options'][$optionKey] = array_diff_key($option, array_flip($this->skippedOptionFields));
         }
         $attribute['options'] = $this->sortDataByPath($attribute['options'], '::label');
         $attributeData[$attributeKey] = array_diff_key($attribute, array_flip($this->skippedAttributeFields));
     }
     $data['configurable_attributes_data']['attributes_data'] = $this->sortDataByPath($attributeData, '::label');
     // prepare and filter values, reset keys in variation matrix
     $variationsMatrix = $data['configurable_attributes_data']['matrix'];
     foreach ($variationsMatrix as $key => $variationMatrix) {
         $variationMatrix['display'] = isset($variationMatrix['display']) ? $variationMatrix['display'] : 'Yes';
         $variationsMatrix[$key] = array_diff_key($variationMatrix, array_flip($this->skippedVariationMatrixFields));
     }
     $data['configurable_attributes_data']['matrix'] = array_values($variationsMatrix);
     return parent::prepareFixtureData($data, $sortFields);
 }
 /**
  * Prepares fixture data for comparison.
  *
  * @param array $data
  * @param array $sortFields [optional]
  * @return array
  */
 protected function prepareFixtureData(array $data, array $sortFields = [])
 {
     $compareData = array_filter($data);
     array_walk_recursive($compareData, function (&$item, $key, $formattingOptions) {
         if (isset($formattingOptions[$key])) {
             $item = number_format($item, $formattingOptions[$key]['decimals'], $formattingOptions[$key]['dec_point'], $formattingOptions[$key]['thousands_sep']);
         }
     }, $this->formattingOptions);
     if (isset($compareData['status'])) {
         $compareData['status'] = 'Product offline';
     }
     if (isset($compareData['quantity_and_stock_status']['qty'])) {
         $compareData['quantity_and_stock_status']['qty'] = '';
         $compareData['quantity_and_stock_status']['is_in_stock'] = 'Out of Stock';
     }
     if (isset($compareData['special_price'])) {
         $compareData['special_price'] = ['special_price' => $compareData['special_price']];
     }
     $compareData['sku'] .= '-1';
     $compareData['url_key'] = $this->prepareUrlKey($compareData['url_key']);
     return parent::prepareFixtureData($compareData, $sortFields);
 }
 /**
  * Assert form data equals product configurable data.
  *
  * @param FixtureInterface $product
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductEdit $productPage
  * @return void
  */
 public function processAssert(FixtureInterface $product, CatalogProductIndex $productGrid, CatalogProductEdit $productPage)
 {
     $product = $this->processFixture($product);
     parent::processAssert($product, $productGrid, $productPage);
 }
 /**
  * Prepares fixture data for comparison
  *
  * @param array $data
  * @param array $sortFields [optional]
  * @return array
  */
 protected function prepareFixtureData(array $data, array $sortFields = [])
 {
     $data['bundle_selections'] = $this->prepareBundleOptions($data['bundle_selections']['bundle_options']);
     return parent::prepareFixtureData($data, $sortFields);
 }