当前位置: 首页>>代码示例>>PHP>>正文


PHP Factory::getApp方法代码示例

本文整理汇总了PHP中magento\mtf\factory\Factory::getApp方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::getApp方法的具体用法?PHP Factory::getApp怎么用?PHP Factory::getApp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在magento\mtf\factory\Factory的用法示例。


在下文中一共展示了Factory::getApp方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCreateConfigurableProduct

 /**
  * Edit configurable product and add new options to attribute
  *
  * @ZephyrId MAGETWO-12840
  * @return void
  */
 public function testCreateConfigurableProduct()
 {
     //Preconditions
     //Preparing Data for original product
     $configurable = Factory::getFixtureFactory()->getMagentoConfigurableProductConfigurableProduct();
     $configurable->switchData('configurable');
     $configurable->persist();
     $productSku = $configurable->getSku();
     //Preparing Data for editing product
     $editProduct = $configurable->getEditData();
     //Steps
     $createProductPage = Factory::getPageFactory()->getCatalogProductNew();
     $productForm = $createProductPage->getProductForm();
     //Login
     Factory::getApp()->magentoBackendLoginUser();
     $productGridPage = Factory::getPageFactory()->getCatalogProductIndex();
     $productGridPage->open();
     //Search and open original configurable product
     $productGridPage->getProductGrid()->searchAndOpen(['sku' => $productSku]);
     //Editing product options
     $productForm->fill($editProduct);
     $createProductPage->getFormPageActions()->save();
     //Verifying
     $createProductPage->getMessagesBlock()->waitSuccessMessage();
     //Flush cache
     $cachePage = Factory::getPageFactory()->getAdminCache();
     $cachePage->open();
     $cachePage->getActionsBlock()->flushMagentoCache();
     //Verifying
     $this->assertOnGrid($editProduct);
     $this->assertOnFrontend($editProduct);
 }
开发者ID:,项目名称:,代码行数:38,代码来源:

示例2: persist

 /**
  * Create product
  *
  * @param FixtureInterface $fixture [optional]
  * @return mixed|string
  */
 public function persist(FixtureInterface $fixture = null)
 {
     Factory::getApp()->magentoBackendLoginUser();
     $createProductPage = Factory::getPageFactory()->getCatalogProductNew();
     $createProductPage->open(['type' => $fixture->getDataConfig()['create_url_params']['type'], 'set' => $fixture->getDataConfig()['create_url_params']['set']]);
     $createProductPage->getProductForm()->fill($fixture);
     $createProductPage->getFormPageActions()->save();
     $createProductPage->getMessagesBlock()->waitSuccessMessage();
 }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例3: open

 /**
  * Open backend page and log in if needed
  *
  * @param array $params
  * @return $this
  */
 public function open(array $params = [])
 {
     Factory::getApp()->magentoBackendLoginUser();
     return parent::open($params);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:11,代码来源:BackendPage.php

示例4: setUp

 /**
  * Login into backend area before test
  */
 protected function setUp()
 {
     Factory::getApp()->magentoBackendLoginUser();
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例5: persist

 /**
  * Create customer group
  */
 public function persist()
 {
     $this->_data['fields']['id']['value'] = Factory::getApp()->magentoCustomerCreateCustomerGroup($this);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:7,代码来源:CustomerGroup.php

示例6: persist

 /**
  * Save Attribute into Magento
  */
 public function persist()
 {
     $attributeIds = Factory::getApp()->magentoCatalogCreateProductAttribute($this);
     $this->_data['fields']['attribute_id']['value'] = $attributeIds['attributeId'];
     $this->_data['fields']['option_ids'] = $attributeIds['optionIds'];
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:10,代码来源:ProductAttribute.php


注:本文中的magento\mtf\factory\Factory::getApp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。