本文整理汇总了PHP中Magento\Mtf\Fixture\FixtureInterface::getDataConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP FixtureInterface::getDataConfig方法的具体用法?PHP FixtureInterface::getDataConfig怎么用?PHP FixtureInterface::getDataConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Mtf\Fixture\FixtureInterface
的用法示例。
在下文中一共展示了FixtureInterface::getDataConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: persist
/**
* Post request for creating simple product.
*
* @param FixtureInterface|null $fixture [optional]
* @return array
*
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function persist(FixtureInterface $fixture = null)
{
$config = $fixture->getDataConfig();
$prefix = isset($config['input_prefix']) ? $config['input_prefix'] : null;
$data = $this->prepareData($fixture, $prefix);
return $this->createProduct($data, $config);
}
示例3: processAssert
/**
* Assert that duplicated product is found by sku and has correct product type, product template,
* product status disabled and out of stock
*
* @param FixtureInterface $product
* @param CatalogProductIndex $productGrid
* @return void
*/
public function processAssert(FixtureInterface $product, CatalogProductIndex $productGrid)
{
$config = $product->getDataConfig();
$filter = ['name' => $product->getName(), 'visibility' => $product->getVisibility(), 'status' => 'Disabled', 'sku' => $product->getSku() . '-1', 'type' => ucfirst($config['create_url_params']['type']) . ' Product', 'price_to' => number_format($product->getPrice(), 2)];
$productGrid->open()->getProductGrid()->search($filter);
$filter['price_to'] = '$' . $filter['price_to'];
\PHPUnit_Framework_Assert::assertTrue($productGrid->getProductGrid()->isRowVisible($filter, false), 'Product duplicate is absent in Products grid.');
}
示例4: selectItem
/**
* Select order item.
*
* @param FixtureInterface $product
* @reutrn void
*/
public function selectItem(FixtureInterface $product)
{
/** @var CatalogProductSimple $product */
$productConfig = $product->getDataConfig();
if (isset($this->productsGrids[$productConfig['type_id']])) {
$this->blockFactory->create($this->productsGrids[$productConfig['type_id']], ['element' => $this->_rootElement])->selectItem($product);
} else {
$this->searchAndSelect(['name' => $product->getName()]);
}
}
示例5: selectItem
/**
* Select order item.
*
* @param FixtureInterface $product
* @reutrn void
*/
public function selectItem(FixtureInterface $product)
{
/** @var CatalogProductSimple $product */
$productConfig = $product->getDataConfig();
$productType = isset($productConfig['type_id']) ? ucfirst($productConfig['type_id']) : '';
$productGridClass = 'Enterprise\\Rma\\Test\\Block\\Adminhtml\\Rma\\NewRma\\Tab\\Items\\Order\\' . $productType . 'Grid';
if (class_exists($productGridClass)) {
$productGrid = $this->blockFactory->create($productGridClass, ['element' => $this->_rootElement]);
$productGrid->selectItem($product);
} else {
$this->searchAndSelect(['name' => $product->getName()]);
}
}
示例6: getCartItem
/**
* Get cart item block
*
* @param FixtureInterface $product
* @return CartItem
*/
public function getCartItem(FixtureInterface $product)
{
$dataConfig = $product->getDataConfig();
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
$cartItem = null;
if ($this->hasRender($typeId)) {
$cartItem = $this->callRender($typeId, 'getCartItem', ['product' => $product]);
} else {
$cartItemBlock = $this->_rootElement->find(sprintf($this->cartItemByProductName, $product->getName()), Locator::SELECTOR_XPATH);
$cartItem = $this->blockFactory->create('Magento\\Weee\\Test\\Block\\Cart\\CartItem', ['element' => $cartItemBlock]);
}
return $cartItem;
}
示例7: save
/**
* Click on "Save" button
*
* @param FixtureInterface|null $product [optional]
* @return void
*/
public function save(FixtureInterface $product = null)
{
$typeId = null;
if ($product) {
$dataConfig = $product->getDataConfig();
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
}
if ($this->hasRender($typeId)) {
$this->callRender($typeId, 'save', ['product' => $product]);
} else {
parent::save();
}
}
示例8: fillOptions
/**
* Fill in the option specified for the product
*
* @param FixtureInterface $product
* @return void
*
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function fillOptions(FixtureInterface $product)
{
$dataConfig = $product->getDataConfig();
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
$checkoutData = null;
/** @var CatalogProductSimple $product */
if ($this->hasRender($typeId)) {
$this->callRender($typeId, 'fillOptions', ['product' => $product]);
}
/** @var CatalogProductSimple $product */
$checkoutData = $product->getCheckoutData();
$checkoutCustomOptions = isset($checkoutData['options']['custom_options']) ? $checkoutData['options']['custom_options'] : [];
$customOptions = $product->hasData('custom_options') ? $product->getDataFieldConfig('custom_options')['source']->getCustomOptions() : [];
$checkoutCustomOptions = $this->prepareCheckoutData($customOptions, $checkoutCustomOptions);
$this->getCustomOptionsBlock()->fillCustomOptions($checkoutCustomOptions);
}
示例9: fill
/**
* Fill the product form.
*
* @param FixtureInterface $product
* @param SimpleElement|null $element
* @param FixtureInterface|null $category
* @return $this
* @throws \Exception
*
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function fill(FixtureInterface $product, SimpleElement $element = null, FixtureInterface $category = null)
{
$this->waitPageToLoad();
$dataConfig = $product->getDataConfig();
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
if ($this->hasRender($typeId)) {
$renderArguments = ['product' => $product, 'element' => $element, 'category' => $category];
$this->callRender($typeId, 'fill', $renderArguments);
} else {
$sections = $this->getFixtureFieldsByContainers($product);
if ($category) {
$sections['product-details']['category_ids']['value'] = $category->getName();
}
$this->fillContainers($sections, $element);
}
return $this;
}
示例10: getOptions
/**
* Return product options.
*
* @param FixtureInterface $product
* @return array
*/
public function getOptions(FixtureInterface $product)
{
/** @var CatalogProductSimple $product */
$dataConfig = $product->getDataConfig();
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
return $this->hasRender($typeId) ? $this->callRender($typeId, 'getOptions', ['product' => $product]) : $this->getCustomOptionsBlock()->getOptions($product);
}
示例11: getProductType
/**
* Get product type
*
* @return string
*/
protected function getProductType()
{
$config = $this->product->getDataConfig();
return ucfirst($config['type_id']) . ' Product';
}
示例12: getProductType
/**
* Get product type.
*
* @param FixtureInterface $product
* @return string|null
*/
protected function getProductType(FixtureInterface $product)
{
$dataConfig = $product->getDataConfig();
return isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
}
示例13: createAndSaveProduct
/**
* Create and save product
*
* @param FixtureInterface $product
* @return void
*/
protected function createAndSaveProduct(FixtureInterface $product)
{
$dataConfig = $product->getDataConfig();
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
$this->catalogProductIndex->open();
$this->catalogProductIndex->getGridPageActionBlock()->addProduct($typeId);
$this->catalogProductNew->getProductForm()->fill($product);
$this->catalogProductNew->getFormPageActions()->save($product);
}
示例14: fill
/**
* Fill the product form.
*
* @param FixtureInterface $product
* @param SimpleElement|null $element [optional]
* @param FixtureInterface|null $category [optional]
* @return FormTabs
*
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function fill(FixtureInterface $product, SimpleElement $element = null, FixtureInterface $category = null)
{
$dataConfig = $product->getDataConfig();
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
if ($this->hasRender($typeId)) {
$renderArguments = ['product' => $product, 'element' => $element, 'category' => $category];
$this->callRender($typeId, 'fill', $renderArguments);
} else {
$tabs = $this->getFieldsByTabs($product);
if ($category) {
$tabs['product-details']['category_ids']['value'] = $category->getName();
}
$this->showAdvancedSettings();
$this->fillTabs($tabs, $element);
if ($product->hasData('custom_attribute')) {
$this->createCustomAttribute($product);
}
}
return $this;
}
示例15: getCartItemClass
/**
* Get module name from fixture.
*
* @param FixtureInterface $product
* @return string
*/
protected function getCartItemClass(FixtureInterface $product)
{
$typeId = $product->getDataConfig()['type_id'];
return ObjectManager::getInstance()->create($this->itemRender[$typeId], ['product' => $product]);
}