/** * Prepare fixture data for verify * * @param DownloadableProductInjectable $product * @return array */ protected function prepareFixtureData(DownloadableProductInjectable $product) { $data = $this->sortDataByPath($product->getDownloadableSample(), 'downloadable/sample::sort_order'); foreach ($data['downloadable']['sample'] as $key => $link) { $link = array_intersect_key($link, array_flip($this->linkField)); $data['downloadable']['sample'][$key] = $link; } $data = array_intersect_key($data, array_flip($this->downloadableSampleField)); return $data; }
/** * Prepare fixture data for verify * * @param DownloadableProductInjectable $product * @return array */ protected function prepareFixtureData(DownloadableProductInjectable $product) { $data = $this->sortDataByPath($product->getDownloadableLinks(), 'downloadable/link::sort_order'); foreach ($data['downloadable']['link'] as $key => $link) { $link['links_purchased_separately'] = $data['links_purchased_separately']; $link = array_intersect_key($link, array_flip($this->linkField)); $data['downloadable']['link'][$key] = $link; } $data = array_intersect_key($data, array_flip($this->downloadableLinksField)); return $data; }
/** * Test update downloadable product * * @param DownloadableProductInjectable $product * @param CatalogCategory $category * @return void */ public function testUpdateDownloadableProduct(DownloadableProductInjectable $product, CatalogCategory $category) { $filter = ['sku' => $this->product->getSku()]; $this->catalogProductIndex->open()->getProductGrid()->searchAndOpen($filter); $productBlockForm = $this->catalogProductEdit->getProductForm(); $productBlockForm->fill($product, null, $category); $this->catalogProductEdit->getFormPageActions()->save(); }