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


PHP CatalogProductAttribute::getFrontendLabel方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that deleted attribute can't be added to attribute set on Product Page via Add Attribute control.
  *
  * @param CatalogProductAttribute $productAttribute
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductNew $newProductPage
  * @return void
  */
 public function processAssert(CatalogProductAttribute $productAttribute, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
 {
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addProduct('simple');
     $newProductPage->getFormPageActions()->addNewAttribute();
     $filter = ['label' => $productAttribute->getFrontendLabel()];
     \PHPUnit_Framework_Assert::assertFalse($newProductPage->getProductForm()->getAttributesSearchGrid()->isRowVisible($filter), 'Attribute \'' . $productAttribute->getFrontendLabel() . '\' is found in Attributes grid.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:16,代码来源:AssertProductAttributeAbsenceInSearchOnProductForm.php

示例2: isExistAttributeInSearchResult

 /**
  * Checking not exist attribute in search result.
  *
  * @param CatalogProductAttribute $productAttribute
  * @return bool
  */
 public function isExistAttributeInSearchResult($productAttribute)
 {
     $this->find($this->actionToggle)->click();
     $this->find($this->suggest)->setValue($productAttribute->getFrontendLabel());
     $this->waitResult();
     $attributeSelector = sprintf($this->searchArrtibute, $productAttribute->getFrontendLabel());
     return $this->find($this->searchResult)->find($attributeSelector, Locator::SELECTOR_XPATH)->isVisible();
 }
开发者ID:opexsw,项目名称:magento2,代码行数:14,代码来源:Search.php

示例3: run

 /**
  * Delete product attribute step.
  *
  * @return void
  */
 public function run()
 {
     $filter = $this->attribute->hasData('attribute_code') ? ['attribute_code' => $this->attribute->getAttributeCode()] : ['frontend_label' => $this->attribute->getFrontendLabel()];
     $this->catalogProductAttributeIndex->open();
     if ($this->catalogProductAttributeIndex->getGrid()->isRowVisible($filter)) {
         $this->catalogProductAttributeIndex->getGrid()->searchAndOpen($filter);
         $this->catalogProductAttributeNew->getPageActions()->delete();
     }
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:14,代码来源:DeleteAttributeStep.php

示例4: processAssert

 /**
  * Assert check whether the attribute is used to create a configurable products
  *
  * @param CatalogProductAttribute $productAttribute
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductIndex $productGrid
  * @param FixtureFactory $fixtureFactory
  * @param CatalogProductNew $newProductPage
  */
 public function processAssert(CatalogProductAttribute $attribute, CatalogProductIndex $productGrid, FixtureFactory $fixtureFactory, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttribute = null)
 {
     $this->attribute = !is_null($productAttribute) ? $productAttribute : $attribute;
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addProduct('configurable');
     $productConfigurable = $fixtureFactory->createByCode('catalogProductConfigurable', ['dataSet' => 'default', 'data' => ['configurable_attributes_data' => ['preset' => 'one_variation', 'attributes' => [$this->attribute]]]]);
     $productBlockForm = $newProductPage->getForm();
     $productBlockForm->fill($productConfigurable);
     \PHPUnit_Framework_Assert::assertTrue($newProductPage->getForm()->findAttribute($this->attribute->getFrontendLabel()), "Product attribute is absent on the product page.");
 }
开发者ID:aiesh,项目名称:magento2,代码行数:19,代码来源:AssertProductAttributeIsConfigurable.php

示例5: isExistAttributeInSearchResult

 /**
  * Checking not exist attribute in search result
  *
  * @param CatalogProductAttribute $productAttribute
  * @return bool
  */
 public function isExistAttributeInSearchResult($productAttribute)
 {
     $this->find($this->actionToggle)->click();
     $this->find($this->suggest)->setValue($productAttribute->getFrontendLabel());
     $this->waitResult();
     if ($this->find($this->searchResult)->getText() == $productAttribute->getFrontendLabel()) {
         return true;
     }
     return false;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:16,代码来源:Search.php

示例6: processAssert

 /**
  * Check whether the attribute is unique.
  *
  * @param CatalogProductIndex $catalogProductIndex
  * @param CatalogProductEdit $catalogProductEdit
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductSimple $product,
  * @param FixtureFactory $fixtureFactory
  * @throws \Exception
  * @return void
  */
 public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, CatalogProductAttribute $attribute, CatalogProductSimple $product, FixtureFactory $fixtureFactory)
 {
     $simpleProduct = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'product_with_category_with_anchor', 'data' => ['attribute_set_id' => ['attribute_set' => $product->getDataFieldConfig('attribute_set_id')['source']->getAttributeSet()], 'custom_attribute' => $attribute]]);
     $catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple');
     $productForm = $catalogProductEdit->getProductForm();
     $productForm->fill($simpleProduct);
     $catalogProductEdit->getFormPageActions()->save();
     $failedAttributes = $productForm->getRequireNoticeAttributes($simpleProduct);
     $actualMessage = isset($failedAttributes['product-details'][$attribute->getFrontendLabel()]) ? $failedAttributes['product-details'][$attribute->getFrontendLabel()] : null;
     \PHPUnit_Framework_Assert::assertEquals(sprintf(self::UNIQUE_MESSAGE, $attribute->getFrontendLabel()), $actualMessage, 'JS error notice on product edit page is not equal to expected.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:22,代码来源:AssertProductAttributeIsUnique.php

示例7: processAssert

 /**
  * Check whether the attribute filter is displayed on the frontend in Layered navigation.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param InjectableFixture $product
  * @param CatalogProductAttribute $attribute
  * @param CmsIndex $cmsIndex
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, InjectableFixture $product, CatalogProductAttribute $attribute, CmsIndex $cmsIndex, FixtureFactory $fixtureFactory)
 {
     $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'product_with_category_with_anchor', 'data' => ['category_ids' => ['presets' => null, 'category' => $product->getDataFieldConfig('category_ids')['source']->getCategories()[0]]]])->persist();
     $cmsIndex->open()->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]);
     $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertTrue(in_array($label, $catalogCategoryView->getLayeredNavigationBlock()->getFilters()), 'Attribute is absent in layered navigation on category page.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:AssertProductAttributeIsFilterable.php

示例8: processAssert

 /**
  * Check whether attribute is displayed in the advanced search form on the frontend.
  *
  * @param CatalogProductAttribute $attribute
  * @param AdvancedSearch $advancedSearch
  * @return void
  */
 public function processAssert(CatalogProductAttribute $attribute, AdvancedSearch $advancedSearch)
 {
     $advancedSearch->open();
     $formLabels = $advancedSearch->getForm()->getFormlabels();
     $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertTrue(in_array($label, $formLabels), 'Attribute is absent on advanced search form.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:AssertProductAttributeDisplayingOnSearchForm.php

示例9: processAssert

 /**
  * Assert that product attribute can be used on promo rules conditions.
  *
  * @param CatalogRuleIndex $catalogRuleIndex
  * @param CatalogRuleNew $catalogRuleNew
  * @param CatalogProductAttribute $attribute
  * @return void
  */
 public function processAssert(CatalogRuleIndex $catalogRuleIndex, CatalogRuleNew $catalogRuleNew, CatalogProductAttribute $attribute)
 {
     $catalogRuleIndex->open();
     $catalogRuleIndex->getGridPageActions()->addNew();
     $catalogRuleNew->getEditForm()->openTab('conditions');
     \PHPUnit_Framework_Assert::assertTrue($catalogRuleNew->getEditForm()->isAttributeInConditions($attribute->getFrontendLabel()), 'Product attribute can\'t be used on promo rules conditions.');
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:15,代码来源:AssertProductAttributeIsUsedPromoRules.php

示例10: processAssert

 /**
  * Assert that deleted attribute can't be used for Products' Export
  *
  * @param AdminExportIndex $exportIndex
  * @param CatalogProductAttribute $attribute
  * @param ImportExport $export
  * @return void
  */
 public function processAssert(AdminExportIndex $exportIndex, CatalogProductAttribute $attribute, ImportExport $export)
 {
     $exportIndex->open();
     $exportIndex->getExportForm()->fill($export);
     $filter = ['attribute_code' => $attribute->getAttributeCode()];
     \PHPUnit_Framework_Assert::assertFalse($exportIndex->getFilterExport()->isRowVisible($filter), 'Attribute \'' . $attribute->getFrontendLabel() . '\' is present in Filter export grid');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AssertProductAttributeAbsenceForExport.php

示例11: processAssert

 /**
  * Check whether there is an opportunity to compare products using given attribute.
  *
  * @param InjectableFixture $product
  * @param CatalogProductAttribute $attribute
  * @param BrowserInterface $browser
  * @param CatalogProductView $catalogProductView
  * @param CatalogProductCompare $catalogProductCompare
  */
 public function processAssert(InjectableFixture $product, CatalogProductAttribute $attribute, BrowserInterface $browser, CatalogProductView $catalogProductView, CatalogProductCompare $catalogProductCompare)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->clickAddToCompare();
     $catalogProductCompare->open();
     $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertTrue(in_array($label, $catalogProductCompare->getCompareProductsBlock()->getComparableAttributes()), 'Attribute is absent on product compare page.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertProductAttributeIsComparable.php

示例12: hasHtmlTagInAttributeValue

 /**
  * Check if attribute value contains tag.
  *
  * @param CatalogProductAttribute $attribute
  * @return bool
  */
 public function hasHtmlTagInAttributeValue(CatalogProductAttribute $attribute)
 {
     $data = $attribute->getData();
     $defaultValue = preg_grep('/^default_value/', array_keys($data));
     $selector = $this->resolveHtmlStructure($data[array_shift($defaultValue)]);
     $element = $this->getProductAttributes()[$attribute->getFrontendLabel()];
     return $this->checkHtmlTagStructure($element, $selector)->isVisible();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:Additional.php

示例13: testDeleteProductAttribute

 /**
  * Run DeleteProductAttributeEntity test.
  *
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductAttributeIndex $attributeIndex
  * @param CatalogProductAttributeNew $attributeNew
  * @return void
  */
 public function testDeleteProductAttribute(CatalogProductAttribute $attribute, CatalogProductAttributeIndex $attributeIndex, CatalogProductAttributeNew $attributeNew)
 {
     //Precondition
     $attribute->persist();
     //Steps
     $attributeIndex->open();
     $attributeIndex->getGrid()->searchAndOpen(['frontend_label' => $attribute->getFrontendLabel()]);
     $attributeNew->getPageActions()->delete();
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:17,代码来源:DeleteProductAttributeEntityTest.php

示例14: processAssert

 /**
  * Assert that after save a attribute set on edit product set page displays:
  * 1. Correct attribute set name in Attribute set name field passed from fixture
  * 2. Created Product Attribute (if was added)
  *
  * @param CatalogProductSetIndex $productSet
  * @param CatalogProductSetEdit $productSetEdit
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogProductAttribute $productAttribute
  * @return void
  */
 public function processAssert(CatalogProductSetIndex $productSet, CatalogProductSetEdit $productSetEdit, CatalogAttributeSet $attributeSet, CatalogProductAttribute $productAttribute = null)
 {
     $filterAttribute = ['set_name' => $attributeSet->getAttributeSetName()];
     $productSet->open();
     $productSet->getGrid()->searchAndOpen($filterAttribute);
     \PHPUnit_Framework_Assert::assertEquals($filterAttribute['set_name'], $productSetEdit->getAttributeSetEditBlock()->getAttributeSetName(), 'Attribute Set not found' . "\nExpected: " . $filterAttribute['set_name'] . "\nActual: " . $productSetEdit->getAttributeSetEditBlock()->getAttributeSetName());
     if ($productAttribute !== null) {
         $attributeLabel = $productAttribute->getFrontendLabel();
         \PHPUnit_Framework_Assert::assertTrue($productSetEdit->getAttributeSetEditBlock()->checkProductAttribute($attributeLabel), "Product Attribute is absent on Attribute Set Groups");
     }
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:22,代码来源:AssertAttributeSetForm.php

示例15: processAssert

 /**
  * Assert that deleted attribute can't be added to attribute set on Product Page via Add Attribute control.
  *
  * @param CatalogProductAttribute $productAttribute
  * @param ConfigurableProduct $assertProduct
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductNew $newProductPage
  * @return void
  */
 public function processAssert(CatalogProductAttribute $productAttribute, ConfigurableProduct $assertProduct, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
 {
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addProduct('simple');
     /** @var VariationsTab $variationsTab */
     $newProductPage->getProductForm()->fill($assertProduct);
     $variationsTab = $newProductPage->getProductForm()->getSection(self::TAB_VARIATIONS);
     $variationsTab->createConfigurations();
     $attributesGrid = $variationsTab->getAttributeBlock()->getAttributesGrid();
     \PHPUnit_Framework_Assert::assertFalse($attributesGrid->isRowVisible(['frontend_label' => $productAttribute->getFrontendLabel()]), "Product attribute found in Attribute Search form.");
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:20,代码来源:AssertProductAttributeAbsenceInVariationsSearch.php


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