10 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit;
11 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
12 use Magento\Mtf\TestCase\Injectable;
55 CatalogProductIndex $catalogProductIndexNewPage,
56 CatalogProductEdit $catalogProductEditPage
58 $this->catalogProductIndex = $catalogProductIndexNewPage;
59 $this->catalogProductEdit = $catalogProductEditPage;
69 public function test(BundleProduct
$product, BundleProduct $originalProduct)
72 $originalProduct->persist();
75 $filter = [
'sku' => $originalProduct->getSku()];
77 $this->catalogProductIndex->open();
78 $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter);
80 $form = $this->catalogProductEdit->getProductForm();
81 $form->openSection(
'bundle');
82 $container = $form->getSection(
'bundle');
83 $containerFields =
$product->getData()[
'bundle_selections'][
'bundle_options_delete'];
84 $container->deleteFieldsData($containerFields);
86 $form->openSection(
'product-details');
87 $container = $form->getSection(
'product-details');
88 $containerFields =
$product->getData();
89 unset($containerFields[
'bundle_selections']);
90 $container->setFieldsData($containerFields);
92 $this->catalogProductEdit->getFormPageActions()->save();
__inject(CatalogProductIndex $catalogProductIndexNewPage, CatalogProductEdit $catalogProductEditPage)
test(BundleProduct $product, BundleProduct $originalProduct)