/** * Initialize fixture data * * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function _initData() { $this->_data['checkout'] = ['prices' => ['price_from' => 110, 'price_to' => 120], 'selection' => [0]]; parent::_initData(); $this->_data['fields'] = array_merge_recursive($this->_data['fields'], ['sku_type' => ['value' => 'Fixed', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'price_type' => ['value' => 'Fixed', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'price' => ['value' => 100, 'group' => static::GROUP_PRODUCT_DETAILS], 'tax_class_id' => ['value' => 'Taxable Goods', 'input_value' => '2', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'weight_type' => ['value' => 'Fixed', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'weight' => ['value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS], 'product_website_1' => ['value' => 'Yes', 'input_value' => [1], 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'website_ids'], 'shipment_type' => ['value' => 'Separately', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'bundle_selections' => ['value' => ['bundle_options' => [['title' => 'Drop-down Option', 'type' => 'Drop-down', 'required' => 'Yes', 'assigned_products' => [['search_data' => ['name' => '%item1_simple1::getName%'], 'data' => ['selection_price_value' => 10, 'selection_price_type' => 'Fixed', 'selection_qty' => 1, 'product_id' => '%item1_simple1::getProductId%']], ['search_data' => ['name' => '%item1_virtual2::getName%'], 'data' => ['selection_price_value' => 20, 'selection_price_type' => 'Percent', 'selection_qty' => 1, 'product_id' => '%item1_virtual2::getProductId%']]]]]], 'group' => static::GROUP]]); $this->_repository = Factory::getRepositoryFactory()->getMagentoBundleBundle($this->_dataConfig, $this->_data); }
/** * {@inheritdoc} */ protected function _initData() { parent::_initData(); $this->_dataConfig = ['constraint' => 'Success', 'grid_filter' => ['name'], 'create_url_params' => ['type' => 'virtual', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID], 'input_prefix' => 'product']; $data = ['is_virtual' => ['value' => '', 'group' => null], 'price' => ['value' => 15, 'group' => static::GROUP_PRODUCT_DETAILS], 'tax_class_id' => ['value' => 'Taxable Goods', 'input_value' => '2', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'qty' => ['value' => 1000, 'group' => static::GROUP_PRODUCT_DETAILS, 'input_name' => 'product[quantity_and_stock_status][qty]'], 'product_website_1' => ['value' => 'Yes', 'input_value' => 1, 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'product[website_ids][]'], 'inventory_manage_stock' => ['value' => 'No', 'input_value' => '0', 'group' => static::GROUP_PRODUCT_INVENTORY, 'input' => 'select', 'input_name' => 'product[stock_data][manage_stock]']]; $this->_data['fields'] = array_merge($this->_data['fields'], $data); $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogVirtualProduct($this->_dataConfig, $this->_data); }
/** * {inheritdoc} */ protected function _initData() { parent::_initData(); $this->_dataConfig = ['constraint' => 'Success', 'grid_filter' => ['name'], 'create_url_params' => ['type' => 'simple', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID], 'input_prefix' => 'product']; $data = $this->_getPreparedData(); $this->_data['fields'] = array_merge($this->_data['fields'], $data); $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogSimpleProduct($this->_dataConfig, $this->_data); }
/** * {inheritdoc} */ protected function _initData() { parent::_initData(); $this->_dataConfig = ['type_id' => 'downloadable', 'constraint' => 'Success', 'grid_filter' => ['name'], 'create_url_params' => ['type' => 'downloadable', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID], 'input_prefix' => 'product']; $data = ['is_virtual' => ['value' => '', 'group' => null], 'price' => ['value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS], 'qty' => ['value' => 1000, 'group' => static::GROUP_PRODUCT_DETAILS, 'input_name' => 'product[quantity_and_stock_status][qty]'], 'quantity_and_stock_status' => ['value' => 'In Stock', 'input_value' => 1, 'group' => static::GROUP_PRODUCT_DETAILS, 'input_name' => 'product[quantity_and_stock_status][is_in_stock]'], 'product_website_1' => ['value' => 'Yes', 'input_value' => 1, 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'product[website_ids][]']]; $this->_data['fields'] = $data + $this->_data['fields']; $this->_repository = Factory::getRepositoryFactory()->getMagentoDownloadableDownloadableProduct($this->_dataConfig, $this->_data); }
/** * Init Data */ protected function _initData() { $this->_dataConfig = ['assignType ' => $this->assignType]; $productsArray = []; foreach ($this->_products as $key => $product) { /** @var $product \Magento\Catalog\Test\Fixture\Product */ $productsArray['product_' . $key] = ['sku' => $product->getSku(), 'name' => $product->getName()]; } $this->_data['fields']['cross_sell_products']['value'] = $productsArray; $this->_data['fields']['cross_sell_products']['group'] = $this->group; $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogAssignProducts($this->_dataConfig, $this->_data); }
/** * Initialize fixture data */ protected function _initData() { parent::_initData(); $this->_dataConfig = ['type_id' => 'bundle', 'constraint' => 'Success', 'create_url_params' => ['type' => 'bundle', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID], 'input_prefix' => 'product']; $this->_repository = Factory::getRepositoryFactory()->getMagentoBundleBundle($this->_dataConfig, $this->_data); }
/** * {inheritdoc} */ protected function _initData() { $this->_defaultConfig = ['grid_filter' => ['email'], 'constraint' => 'Success']; $this->_repository = Factory::getRepositoryFactory()->getMagentoCustomerCustomer($this->_dataConfig, $this->_data); //Default data set $this->switchData('customer_US_1'); }
/** * Init Data */ protected function _initData() { $this->_dataConfig = ['type_id' => 'grouped', 'constraint' => 'Success', 'create_url_params' => ['type' => 'grouped', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID]]; $this->_data = ['fields' => ['name' => ['value' => 'Grouped Product %isolation%', 'group' => static::GROUP_PRODUCT_DETAILS], 'sku' => ['value' => 'grouped_sku_%isolation%', 'group' => static::GROUP_PRODUCT_DETAILS], 'grouped_products' => ['value' => ['assigned_product_0' => ['search_data' => ['name' => '%simple::getName%'], 'data' => ['selection_qty' => ['value' => 1], 'product_id' => ['value' => '%simple::getProductId%']]], 'assigned_product_1' => ['search_data' => ['name' => '%virtual::getName%'], 'data' => ['selection_qty' => ['value' => 1], 'product_id' => ['value' => '%virtual::getProductId%']]], 'assigned_product_2' => ['search_data' => ['name' => '%downloadable::getName%'], 'data' => ['selection_qty' => ['value' => 1], 'product_id' => ['value' => '%downloadable::getProductId%']]]], 'group' => static::GROUP]]]; $this->_repository = Factory::getRepositoryFactory()->getMagentoGroupedProductGroupedProduct($this->_dataConfig, $this->_data); }
/** * Init Data * * @return void * * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function _initData() { parent::_initData(); $this->_dataConfig = ['type_id' => 'configurable', 'constraint' => 'Success', 'create_url_params' => ['type' => Repository::CONFIGURABLE, 'set' => static::DEFAULT_ATTRIBUTE_SET_ID]]; $data = ['fields' => ['price' => ['value' => '10', 'group' => static::GROUP_PRODUCT_DETAILS], 'tax_class_id' => ['value' => 'Taxable Goods', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select', 'input_value' => '2'], 'weight' => ['value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS], 'product_website_1' => ['value' => 'Yes', 'input_value' => [1], 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'website_ids'], 'configurable_attributes_data' => ['value' => ['0' => ['label' => ['value' => '%attribute_label_1%'], '0' => ['option_label' => ['value' => '%attribute_1_option_label_1%'], 'pricing_value' => ['value' => '1'], 'is_percent' => ['value' => 'No'], 'include' => ['value' => 'Yes']], '1' => ['option_label' => ['value' => '%attribute_1_option_label_2%'], 'pricing_value' => ['value' => '2'], 'is_percent' => ['value' => 'No'], 'include' => ['value' => 'Yes']]]], 'group' => static::GROUP], 'variations-matrix' => ['value' => ['0' => ['configurable_attribute' => ['0' => ['attribute_option' => '%attribute_1_option_label_1%']], 'value' => ['display' => ['value' => 'Yes', 'input' => 'checkbox'], 'name' => ['value' => 'Variation 0-%isolation%'], 'sku' => ['value' => 'Variation 0-%isolation%'], 'qty' => ['value' => '100']]], '1' => ['configurable_attribute' => ['0' => ['attribute_option' => '%attribute_1_option_label_2%']], 'value' => ['display' => ['value' => 'Yes', 'input' => 'checkbox'], 'name' => ['value' => 'Variation 1-%isolation%'], 'sku' => ['value' => 'Variation 1-%isolation%'], 'qty' => ['value' => '200']]]], 'group' => static::GROUP]], 'checkout_data' => ['options' => ['configurable_options' => [['title' => '0', 'value' => '0']], 'qty' => 1], 'special_price' => '10']]; $this->_data = array_merge_recursive($this->_data, $data); $this->_repository = Factory::getRepositoryFactory()->getMagentoConfigurableProductConfigurableProduct($this->_dataConfig, $this->_data); }
/** * Init Data */ protected function _initData() { $this->_dataConfig = ['assignType ' => $this->assignType]; $this->_data = ['fields' => [$this->assignType . '_products' => ['value' => ['product_1' => ['sku' => '%' . $this->assignType . '_simple::getSku%', 'name' => '%' . $this->assignType . '_simple::getName%'], 'product_2' => ['sku' => '%' . $this->assignType . '_configurable::getSku%', 'name' => '%' . $this->assignType . '_configurable::getName%']], 'group' => $this->group]]]; $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogAssignProducts($this->_dataConfig, $this->_data); }
/** * Initialize fixture data */ protected function _initData() { $this->_data = ['fields' => ['code' => ['value' => 'Test group %isolation%'], 'tax_class' => ['value' => 'Retail Customer', 'input_value' => 3]]]; $this->_defaultConfig = []; $this->_repository = Factory::getRepositoryFactory()->getMagentoCustomerCustomerGroup($this->_dataConfig, $this->_data); }
/** * {@inheritdoc} */ protected function _initData() { $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogRuleCatalogPriceRule($this->_dataConfig, $this->_data); //Default data set $this->switchData(Repository::CATALOG_PRICE_RULE); }
/** * {inheritdoc} */ protected function _initData() { $this->_repository = Factory::getRepositoryFactory()->getMagentoShippingMethod($this->_dataConfig, $this->_data); //Default data set $this->switchData('flat_rate'); }
/** * Init downloadable data */ protected function _initData() { parent::_initData(); $this->_data = array_replace_recursive($this->_data, ['fields' => ['downloadable_link_purchase_type' => ['value' => 'No', 'input_value' => '0']]]); $this->_repository = Factory::getRepositoryFactory()->getMagentoDownloadableDownloadableProduct($this->_dataConfig, $this->_data); }
/** * {inheritdoc} * * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function _initData() { $this->_data = ['fields' => ['attribute_code' => ['value' => 'attribute_code_%isolation%', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN], 'frontend_label' => ['value' => 'Attribute %isolation%', 'input_name' => 'frontend_label[0]', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN], 'frontend_input' => ['value' => 'Dropdown', 'input' => 'select', 'input_value' => 'select', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN], 'is_searchable' => ['value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT], 'is_visible_in_advanced_search' => ['value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT], 'is_comparable' => ['value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT], 'is_filterable' => ['value' => 'Filterable (with results)', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT], 'is_visible_on_front' => ['value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT], 'is_filterable_in_search' => ['value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT]], 'options' => ['value' => ['option_1' => ['label' => ['value' => 'Option 1 %isolation%', 'input_name' => 'option[value][option_0][0]', 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[1]/td[3]/input', 'strategy' => Locator::SELECTOR_XPATH], 'default' => ['value' => 'Yes', 'input' => 'checkbox', 'input_name' => 'default[0]', 'input_value' => 'option_0', 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[1]/td[2]/input', 'strategy' => Locator::SELECTOR_XPATH]], 'option_2' => ['label' => ['value' => 'Option 2 %isolation%', 'input_name' => 'option[value][option_1][0]', 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[2]/td[3]/input', 'strategy' => Locator::SELECTOR_XPATH], 'default' => ['value' => 'No', 'input' => 'checkbox', 'input_name' => 'default[1]', 'input_value' => 'option_1', 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[2]/td[2]/input', 'strategy' => Locator::SELECTOR_XPATH]]]]]; $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogProductAttribute($this->_dataConfig, $this->_data); }
/** * Init downloadable data */ protected function _initData() { parent::_initData(); $this->_data = array_replace_recursive($this->_data, ['fields' => ['downloadable_links' => ['value' => ['title' => 'Links%isolation%', 'links_purchased_separately' => 'Yes', 'downloadable' => ['link' => [['title' => 'row1%isolation%', 'price' => 2.43, 'number_of_downloads' => 2, 'sample' => ['sample_type_url' => 'Yes', 'sample_url' => 'http://example.com'], 'file_type_url' => 'Yes', 'file_link_url' => 'http://example.com', 'is_shareable' => 'No', 'sort_order' => 0]]]], 'group' => static::GROUP]]]); $this->_repository = Factory::getRepositoryFactory()->getMagentoDownloadableDownloadableProduct($this->_dataConfig, $this->_data); }
/** * {inheritdoc} */ protected function _initData() { $this->_repository = Factory::getRepositoryFactory()->getMagentoCustomerAddress($this->_dataConfig, $this->_data); //Default data set $this->switchData('address_US_1'); }
/** * {@inheritdoc} */ protected function _initData() { $this->_repository = Factory::getRepositoryFactory()->getMagentoUserRole($this->_dataConfig, $this->_data); }