當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。