本文整理汇总了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();
}
}
示例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();
}
}
示例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');
}
示例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);
}
示例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();
}
示例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)];
}
示例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)];
}
示例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');
}
示例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.');
}
示例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.');
}