Exemplo n.º 1
0
 /**
  * Initialize fixture data
  */
 protected function _initData()
 {
     $this->_data['checkout'] = array('prices' => array('price_from' => 10, 'price_to' => 15), 'selection' => array('bundle_item_0' => 'assigned_product_0'));
     parent::_initData();
     $this->_data['fields'] = array_merge_recursive($this->_data['fields'], array('sku_type' => array('value' => 'Dynamic', 'input_value' => '0', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'price_type' => array('value' => 'Dynamic', 'input_value' => '0', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'weight_type' => array('value' => 'Dynamic', 'input_value' => '0', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'product_website_1' => array('value' => 'Yes', 'input_value' => array(1), 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'website_ids'), 'shipment_type' => array('value' => 'Separately', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'bundle_selections' => array('value' => array('bundle_options' => array('bundle_item_0' => array('title' => 'Drop-down Option', 'type' => 'Drop-down', 'required' => 'Yes', 'assigned_products' => array('assigned_product_0' => array('search_data' => array('name' => '%item1_simple1::getName%'), 'data' => array('selection_qty' => 1, 'product_id' => '%item1_simple1::getProductId%')), 'assigned_product_1' => array('search_data' => array('name' => '%item1_virtual2::getName%'), 'data' => array('selection_qty' => 1, 'product_id' => '%item1_virtual2::getProductId%')))))), 'group' => static::GROUP)));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoBundleBundle($this->_dataConfig, $this->_data);
 }
Exemplo n.º 2
0
 /**
  * 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);
 }
Exemplo n.º 3
0
 /**
  * Init Data
  */
 protected function _initData()
 {
     $this->_dataConfig = array('assignType ' => $this->assignType);
     /** @var  $type Related|Upsell */
     $type = 'Magento\\Catalog\\Test\\Block\\Adminhtml\\Product\\Edit\\Tab\\' . ucfirst(strtolower($this->assignType));
     $this->_data = array('fields' => array($this->assignType . '_products' => array('value' => array('product_1' => array('sku' => '%' . $this->assignType . '_simple::getProductSku%', 'name' => '%' . $this->assignType . '_simple::getName%'), 'product_2' => array('sku' => '%' . $this->assignType . '_configurable::getProductSku%', 'name' => '%' . $this->assignType . '_configurable::getName%')), 'group' => $type::GROUP)));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogAssignProducts($this->_dataConfig, $this->_data);
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function _initData()
 {
     parent::_initData();
     $this->_dataConfig = array('constraint' => 'Success', 'grid_filter' => array('name'), 'create_url_params' => array('type' => 'virtual', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID), 'input_prefix' => 'product');
     $data = array('is_virtual' => array('value' => '', 'group' => null), 'price' => array('value' => 15, 'group' => static::GROUP_PRODUCT_DETAILS), 'tax_class_id' => array('value' => 'Taxable Goods', 'input_value' => '2', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'qty' => array('value' => 1000, 'group' => static::GROUP_PRODUCT_DETAILS, 'input_name' => 'product[quantity_and_stock_status][qty]'), 'product_website_1' => array('value' => 'Yes', 'input_value' => 1, 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'product[website_ids][]'), 'inventory_manage_stock' => array('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);
 }
Exemplo n.º 5
0
 /**
  * {inheritdoc}
  */
 protected function _initData()
 {
     parent::_initData();
     $this->_dataConfig = array('constraint' => 'Success', 'grid_filter' => array('name'), 'create_url_params' => array('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);
 }
Exemplo n.º 6
0
 /**
  * {inheritdoc}
  */
 protected function _initData()
 {
     parent::_initData();
     $this->_dataConfig = array('type_id' => 'downloadable', 'constraint' => 'Success', 'grid_filter' => array('name'), 'create_url_params' => array('type' => 'downloadable', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID), 'input_prefix' => 'product');
     $data = array('is_virtual' => ['value' => '', 'group' => null], 'price' => ['value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS], 'qty' => array('value' => 1000, 'group' => static::GROUP_PRODUCT_DETAILS, 'input_name' => 'product[quantity_and_stock_status][qty]'), 'quantity_and_stock_status' => array('value' => 'In Stock', 'input_value' => 1, 'group' => static::GROUP_PRODUCT_DETAILS, 'input_name' => 'product[quantity_and_stock_status][is_in_stock]'), 'product_website_1' => array('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);
 }
Exemplo n.º 7
0
 /**
  * {inheritdoc}
  */
 protected function _initData()
 {
     parent::_initData();
     $this->_dataConfig = array('constraint' => 'Success', 'grid_filter' => array('name'), 'create_url_params' => array('type' => 'downloadable', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID), 'input_prefix' => 'product');
     $data = array('is_virtual' => ['value' => '', 'group' => null], 'price' => ['value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS]);
     $this->_data['fields'] = $data + $this->_data['fields'];
     $this->_repository = Factory::getRepositoryFactory()->getMagentoDownloadableDownloadableProduct($this->_dataConfig, $this->_data);
 }
Exemplo n.º 8
0
 /**
  * @param Config $configuration
  * @param array $placeholders
  */
 public function __construct(Config $configuration, array $placeholders = array())
 {
     parent::__construct($configuration, $placeholders);
     $this->_placeholders['rewritten_category_request_path'] = array($this, 'getRewrittenRequestPath');
     $this->_repository = Factory::getRepositoryFactory()->getMagentoUrlRewriteUrlRewriteCategory($this->_dataConfig, $this->_data);
     $this->category = Factory::getFixtureFactory()->getMagentoCatalogCategory();
     $this->category->persist();
 }
Exemplo n.º 9
0
 /**
  * @param Config $configuration
  * @param array $placeholders
  */
 public function __construct(Config $configuration, $placeholders = array())
 {
     parent::__construct($configuration, $placeholders);
     $this->_placeholders['rewritten_product_request_path'] = array($this, 'getRewrittenRequestPath');
     $this->_repository = Factory::getRepositoryFactory()->getMagentoUrlRewriteUrlRewriteProduct($this->_dataConfig, $this->_data);
     $this->product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct();
     $this->product->switchData('simple');
     $this->product->persist();
 }
 /**
  * Init Data
  */
 protected function _initData()
 {
     $this->_dataConfig = array('assignType ' => $this->assignType);
     /** @var  $type Related|Upsell */
     $type = 'Magento\\Catalog\\Test\\Block\\Adminhtml\\Product\\Edit\\Tab\\' . ucfirst(strtolower($this->assignType));
     $productsArray = array();
     foreach ($this->_products as $key => $product) {
         /** @var $product \Magento\Catalog\Test\Fixture\Product */
         $productsArray['product_' . $key] = array('sku' => $product->getProductSku(), 'name' => $product->getName());
     }
     $this->_data['fields'][$this->assignType . '_products']['value'] = $productsArray;
     $this->_data['fields'][$this->assignType . '_products']['group'] = $type::GROUP;
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogAssignProducts($this->_dataConfig, $this->_data);
 }
Exemplo n.º 11
0
 /**
  * {inheritdoc}
  */
 protected function _initData()
 {
     $this->_dataConfig = array('constraint' => 'Success', 'request_params' => array('store' => '0'), 'input_prefix' => 'general');
     $this->_data = array('fields' => array('name' => array('value' => 'Subcategory %isolation%', 'group' => static::GROUP_GENERAL_INFORMATION), 'is_active' => array('value' => 'Yes', 'input_value' => '1', 'group' => static::GROUP_GENERAL_INFORMATION, 'input' => 'select'), 'include_in_menu' => array('value' => 'Yes', 'input_value' => '1', 'group' => static::GROUP_GENERAL_INFORMATION, 'input' => 'select'), 'use_config_group_5available_sort_by' => array('value' => '', 'input_name' => 'use_config[0]', 'input_value' => 'available_sort_by', 'group' => static::GROUP_DISPLAY_SETTINGS, 'input' => 'checkbox'), 'use_config_group_5default_sort_by' => array('value' => '', 'input_name' => 'use_config[1]', 'input_value' => 'default_sort_by', 'group' => static::GROUP_DISPLAY_SETTINGS, 'input' => 'checkbox')), 'category_path' => array('value' => 'Default Category', 'input_value' => '2'));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogCategory($this->_dataConfig, $this->_data);
 }
Exemplo n.º 12
0
 /**
  * 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);
 }
Exemplo n.º 13
0
 /**
  * {inheritdoc}
  */
 protected function _initData()
 {
     $this->_defaultConfig = array('grid_filter' => array('email'), 'constraint' => 'Success');
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCustomerCustomer($this->_dataConfig, $this->_data);
     //Default data set
     $this->switchData('customer_US_1');
 }
Exemplo n.º 14
0
 /**
  * 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);
 }
Exemplo n.º 15
0
 /**
  * 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 = array('fields' => array('attribute_code' => array('value' => 'attribute_code_%isolation%', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN), 'frontend_label' => array('value' => 'Attribute %isolation%', 'input_name' => 'frontend_label[0]', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN), 'frontend_input' => array('value' => 'Dropdown', 'input' => 'select', 'input_value' => 'select', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN), 'is_configurable' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN), 'is_searchable' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_visible_in_advanced_search' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_comparable' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_filterable' => array('value' => 'Filterable (with results)', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_visible_on_front' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_filterable_in_search' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT)), 'options' => array('value' => array('option_1' => array('label' => array('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' => array('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' => array('label' => array('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' => array('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);
 }
Exemplo n.º 17
0
 /**
  * {inheritdoc}
  */
 protected function _initData()
 {
     $this->_data = array('fields' => array('nickname' => array('value' => 'Guest customer %isolation%'), 'title' => array('value' => 'Summary review %isolation%'), 'detail' => array('value' => 'Text review %isolation%')));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoReviewReview($this->_dataConfig, $this->_data);
 }
Exemplo n.º 18
0
 /**
  * {@inheritdoc}
  */
 protected function _initData()
 {
     $this->_repository = Factory::getRepositoryFactory()->getMagentoUserRole($this->_dataConfig, $this->_data);
 }
Exemplo n.º 19
0
 /**
  * {inheritdoc}
  */
 protected function _initData()
 {
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCustomerAddress($this->_dataConfig, $this->_data);
     //Default data set
     $this->switchData('address_US_1');
 }
Exemplo n.º 20
0
 /**
  * Initialize fixture data
  */
 protected function _initData()
 {
     $this->_data = array('fields' => array('code' => array('value' => 'Test group %isolation%'), 'tax_class' => array('value' => 'Retail Customer', 'input_value' => 3)));
     $this->_defaultConfig = array();
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCustomerCustomerGroup($this->_dataConfig, $this->_data);
 }
Exemplo n.º 21
0
 /**
  * Init Data
  */
 protected function _initData()
 {
     $this->_dataConfig = array('constraint' => 'Success', 'create_url_params' => array('type' => 'grouped', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID));
     $this->_data = array('fields' => array('name' => array('value' => 'Grouped Product %isolation%', 'group' => static::GROUP_PRODUCT_DETAILS), 'sku' => array('value' => 'grouped_sku_%isolation%', 'group' => static::GROUP_PRODUCT_DETAILS), 'grouped_products' => array('value' => array('assigned_product_0' => array('search_data' => array('name' => '%simple::getName%'), 'data' => array('selection_qty' => array('value' => 1), 'product_id' => array('value' => '%simple::getProductId%'))), 'assigned_product_1' => array('search_data' => array('name' => '%virtual::getName%'), 'data' => array('selection_qty' => array('value' => 1), 'product_id' => array('value' => '%virtual::getProductId%'))), 'assigned_product_2' => array('search_data' => array('name' => '%downloadable::getName%'), 'data' => array('selection_qty' => array('value' => 1), 'product_id' => array('value' => '%downloadable::getProductId%')))), 'group' => static::GROUP)));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogGroupedProduct($this->_dataConfig, $this->_data);
 }
Exemplo n.º 22
0
 /**
  * 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);
 }
Exemplo n.º 23
0
 /**
  * Initialize fixture data
  */
 protected function _initData()
 {
     $this->_data = array('fields' => array('group' => array('value' => 'Main Website Store', 'input' => 'select'), 'name' => array('value' => 'DE%isolation%'), 'code' => array('value' => 'de%isolation%'), 'is_active' => array('value' => 'Enabled', 'input' => 'select')));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoStoreCustomStore($this->_dataConfig, $this->_data);
 }