Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertBundleProductForm.php
Go to the documentation of this file.
1 <?php
8 
10 
15 {
21  protected $specialArray = [
22  'special_from_date' => [
23  'type' => 'date',
24  ],
25  'special_to_date' => [
26  'type' => 'date',
27  ],
28  ];
29 
37  protected function prepareFixtureData(array $data, array $sortFields = [])
38  {
39  $data['bundle_selections'] = $this->prepareBundleOptions(
40  $data['bundle_selections']['bundle_options']
41  );
42 
43  return parent::prepareFixtureData($data, $sortFields);
44  }
45 
52  protected function prepareBundleOptions(array $bundleSelections)
53  {
54  foreach ($bundleSelections as &$item) {
55  unset($item['frontend_type']);
56  foreach ($item['assigned_products'] as &$selection) {
57  $selection['data']['getProductName'] = $selection['search_data']['name'];
58  $selection = $selection['data'];
59  }
60  }
61 
62  return $bundleSelections;
63  }
64 }