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)); }