本文整理匯總了PHP中Magento\Eav\Model\Entity\Attribute\AbstractAttribute::method方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractAttribute::method方法的具體用法?PHP AbstractAttribute::method怎麽用?PHP AbstractAttribute::method使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Eav\Model\Entity\Attribute\AbstractAttribute
的用法示例。
在下文中一共展示了AbstractAttribute::method方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testProcessStaticAttribute
public function testProcessStaticAttribute()
{
$expectedResult = 'attr_table_alias.static_attribute LIKE %name%';
$isNegation = false;
$query = 'static_attribute LIKE %name%';
$this->attribute->method('getAttributeCode')->willReturn('static_attribute');
$this->tableMapper->expects($this->once())->method('getMappingAlias')->willReturn('attr_table_alias');
$this->filter->expects($this->exactly(3))->method('getField')->will($this->returnValue('static_attribute'));
$this->config->expects($this->exactly(1))->method('getAttribute')->with(\Magento\Catalog\Model\Product::ENTITY, 'static_attribute')->will($this->returnValue($this->attribute));
$this->attribute->expects($this->once())->method('isStatic')->will($this->returnValue(true));
$actualResult = $this->target->process($this->filter, $isNegation, $query);
$this->assertSame($expectedResult, $this->removeWhitespaces($actualResult));
}