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


PHP CatalogProductAttribute::getAttributeCode方法代码示例

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


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

示例1: run

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

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

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

示例4: processAssert

 /**
  * Assert that displayed attribute data on edit page equals passed from fixture.
  *
  * @param CatalogProductAttributeIndex $catalogProductAttributeIndex
  * @param CatalogProductAttributeNew $catalogProductAttributeNew
  * @param CatalogProductAttribute $attribute
  * @throws \Exception
  * @return void
  */
 public function processAssert(CatalogProductAttributeIndex $catalogProductAttributeIndex, CatalogProductAttributeNew $catalogProductAttributeNew, CatalogProductAttribute $attribute)
 {
     $filter = ['attribute_code' => $attribute->getAttributeCode()];
     $catalogProductAttributeIndex->open()->getGrid()->searchAndOpen($filter);
     $errors = $this->verifyData($attribute->getData(), $catalogProductAttributeNew->getAttributeForm()->getData($attribute));
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertAttributeForm.php

示例5: testUpdateProductAttribute

 /**
  * Run UpdateProductAttributeEntity test
  *
  * @param CatalogProductAttribute $productAttributeOriginal
  * @param CatalogProductAttribute $attribute
  * @param CatalogAttributeSet $productTemplate
  * @param CatalogProductAttributeIndex $attributeIndex
  * @param CatalogProductAttributeNew $attributeNew
  * @return void
  */
 public function testUpdateProductAttribute(CatalogProductAttribute $productAttributeOriginal, CatalogProductAttribute $attribute, CatalogAttributeSet $productTemplate, CatalogProductAttributeIndex $attributeIndex, CatalogProductAttributeNew $attributeNew)
 {
     //Precondition
     $productTemplate->persist();
     $productAttributeOriginal->persist();
     $filter = ['attribute_code' => $productAttributeOriginal->getAttributeCode()];
     //Steps
     $attributeIndex->open();
     $attributeIndex->getGrid()->searchAndOpen($filter);
     $attributeNew->getAttributeForm()->fill($attribute);
     $attributeNew->getPageActions()->save();
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:22,代码来源:UpdateProductAttributeEntityTest.php

示例6: testUpdateProductAttribute

 /**
  * Run UpdateProductAttributeEntity test
  *
  * @param CatalogProductAttribute $productAttributeOriginal
  * @param CatalogProductAttribute $attribute
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogProductAttributeIndex $attributeIndex
  * @param CatalogProductAttributeNew $attributeNew
  * @param CatalogProductSimple $productSimple
  * @return array
  */
 public function testUpdateProductAttribute(CatalogProductAttribute $productAttributeOriginal, CatalogProductAttribute $attribute, CatalogAttributeSet $attributeSet, CatalogProductAttributeIndex $attributeIndex, CatalogProductAttributeNew $attributeNew, CatalogProductSimple $productSimple)
 {
     //Precondition
     $attributeSet->persist();
     $productAttributeOriginal->persist();
     $filter = ['attribute_code' => $productAttributeOriginal->getAttributeCode()];
     //Steps
     $attributeIndex->open();
     $attributeIndex->getGrid()->searchAndOpen($filter);
     $attributeNew->getAttributeForm()->fill($attribute);
     $attributeNew->getPageActions()->save();
     $attribute = $this->prepareAttribute($attribute, $productAttributeOriginal);
     $productSimple->persist();
     return ['product' => $this->prepareProduct($productSimple, $attribute, $attributeSet)];
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:26,代码来源:UpdateProductAttributeEntityTest.php

示例7: testUpdateProductAttribute

 /**
  * Run UpdateProductAttributeEntity test
  *
  * @param CatalogProductAttribute $productAttributeOriginal
  * @param CatalogProductAttribute $attribute
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogProductAttributeIndex $attributeIndex
  * @param CatalogProductAttributeNew $attributeNew
  * @return array
  */
 public function testUpdateProductAttribute(CatalogProductAttribute $productAttributeOriginal, CatalogProductAttribute $attribute, CatalogAttributeSet $attributeSet, CatalogProductAttributeIndex $attributeIndex, CatalogProductAttributeNew $attributeNew)
 {
     //Precondition
     $attributeSet->persist();
     $productAttributeOriginal->persist();
     $filter = ['attribute_code' => $productAttributeOriginal->getAttributeCode()];
     /** @var CatalogProductSimple $product */
     $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => 'default', 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]]);
     $product->persist();
     $this->objectManager->create('Magento\\Catalog\\Test\\TestStep\\AddAttributeToAttributeSetStep', ['attribute' => $productAttributeOriginal, 'attributeSet' => $attributeSet])->run();
     //Steps
     $attributeIndex->open();
     $attributeIndex->getGrid()->searchAndOpen($filter);
     $attributeNew->getAttributeForm()->fill($attribute);
     $attributeNew->getPageActions()->save();
     $attribute = $this->prepareAttribute($attribute, $productAttributeOriginal);
     return ['product' => $this->prepareProduct($product, $attribute, $attributeSet)];
 }
开发者ID:koliaGI,项目名称:magento2,代码行数:28,代码来源:UpdateProductAttributeEntityTest.php

示例8: getAttributeElement

 /**
  * Get attribute element.
  *
  * @param CatalogProductAttribute $attribute
  * @return CustomAttribute
  */
 public function getAttributeElement(CatalogProductAttribute $attribute)
 {
     return $this->_rootElement->find(sprintf($this->attributeBlock, $attribute->getAttributeCode()), Locator::SELECTOR_CSS, 'Magento\\Catalog\\Test\\Block\\Adminhtml\\Product\\Attribute\\CustomAttribute');
 }
开发者ID:Zash22,项目名称:magento,代码行数:10,代码来源:ProductForm.php

示例9: processAssert

 /**
  * Assert that created product attribute is found in grid
  *
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductAttributeIndex $attributeIndexPage
  * @return void
  */
 public function processAssert(CatalogProductAttribute $attribute, CatalogProductAttributeIndex $attributeIndexPage)
 {
     $attributeIndexPage->open();
     $code = $attribute->getAttributeCode();
     \PHPUnit_Framework_Assert::assertTrue($attributeIndexPage->getGrid()->isRowVisible(['attribute_code' => $code]), 'Attribute with attribute code "' . $code . '" is absent in attribute grid.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:13,代码来源:AssertProductAttributeInGrid.php

示例10: processAssert

 /**
  * Assert that after deleted product attribute cannot be found by attribute code.
  *
  * @param CatalogProductAttributeIndex $attributeIndex
  * @param CatalogProductAttribute $attribute
  * @return void
  */
 public function processAssert(CatalogProductAttributeIndex $attributeIndex, CatalogProductAttribute $attribute)
 {
     $filter = ['attribute_code' => $attribute->getAttributeCode()];
     $attributeIndex->open();
     \PHPUnit_Framework_Assert::assertFalse($attributeIndex->getGrid()->isRowVisible($filter), 'Attribute \'' . $attribute->getFrontendLabel() . '\' is present in Attribute grid.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:AssertProductAttributeAbsenceInGrid.php


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