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


PHP CatalogProductAttribute::hasData方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: processAssert

 /**
  * Assert that attribute present in sort dropdown on search results page on frontend.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogsearchResult $catalogsearchResult
  * @param CatalogProductAttribute $attribute
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogsearchResult $catalogsearchResult, CatalogProductAttribute $attribute, InjectableFixture $product)
 {
     $cmsIndex->open()->getSearchBlock()->search($product->getName());
     $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertTrue(in_array($label, $catalogsearchResult->getListProductBlock()->getSortByValues()), 'Attribute is absent in sort dropdown on search results page on frontend.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AssertProductAttributeIsUsedInSortOnFrontend.php

示例6: processAssert

 /**
  * Check out if the attribute in the navigation bar on the search results page in Layered navigation.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param InjectableFixture $product
  * @param CatalogProductAttribute $attribute
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, InjectableFixture $product, CatalogProductAttribute $attribute)
 {
     $cmsIndex->open()->getSearchBlock()->search($product->getName());
     $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 search page.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:15,代码来源:AssertProductAttributeIsFilterableInSearch.php


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