Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertImportedBundleProducts.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Fixture\FixtureInterface;
11 
16 {
22  protected $productType = 'bundle';
23 
29  protected $neededKeys = [
30  'sku',
31  'name',
32  'associated_skus',
33  'bundle_values',
34  'url_key',
35  ];
36 
43  protected function getDisplayedProductData(FixtureInterface $product)
44  {
46  $bundleSelection = $productData['bundle_selections'][0];
47  $assignedProduct = $bundleSelection['assigned_products'][0];
48 
49  $form = $this->catalogProductEdit->getProductForm();
50  $form->openSection('bundle');
51  $attributeSku = $form->getSection('bundle')->getAttributeSku();
52 
53  $productData['associated_skus'] = $attributeSku;
54  $productType = ($productData['price_type'] === 'Yes')
55  ? 'dynamic'
56  : 'fixed';
57  $productData['bundle_values'] = 'name=' . $bundleSelection['title'] . ',type=select,required=1,sku='
58  . $attributeSku . ',price=0.0000,default=0,default_qty='
59  . $assignedProduct['selection_qty'] .'.0000,price_type=' . $productType;
60 
61  return $this->getResultProductsData($productData);
62  }
63 
69  public function toString()
70  {
71  return 'Products data from CSV import file and data from product edit page are correct and match.';
72  }
73 }
$productData