File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,16 @@ protected function setUp(): void
55
55
public function testModify (array $ attributes , array $ requests , array $ expected ): void
56
56
{
57
57
$ items = [];
58
+ $ searchWeight = 10 ;
58
59
foreach ($ attributes as $ attribute ) {
59
- $ item = $ this ->getMockForAbstractClass (\Magento \Eav \Api \Data \AttributeInterface::class);
60
+ $ item = $ this ->getMockBuilder (\Magento \Catalog \Model \ResourceModel \Eav \Attribute::class)
61
+ ->setMethods (['getAttributeCode ' , 'getSearchWeight ' ])
62
+ ->disableOriginalConstructor ()
63
+ ->getMock ();
60
64
$ item ->method ('getAttributeCode ' )
61
65
->willReturn ($ attribute );
66
+ $ item ->method ('getSearchWeight ' )
67
+ ->willReturn ($ searchWeight );
62
68
$ items [] = $ item ;
63
69
}
64
70
$ reflectionProperty = new \ReflectionProperty ($ this ->collection , '_items ' );
@@ -76,6 +82,7 @@ public function modifyDataProvider(): array
76
82
[
77
83
[
78
84
'name ' ,
85
+ 'sku ' ,
79
86
],
80
87
[
81
88
'search_1 ' => [
@@ -133,9 +140,15 @@ public function modifyDataProvider(): array
133
140
[
134
141
'field ' => '* '
135
142
],
143
+ [
144
+ 'field ' => 'sku ' ,
145
+ 'matchCondition ' => 'match_phrase_prefix ' ,
146
+ 'boost ' => 10
147
+ ],
136
148
[
137
149
'field ' => 'name ' ,
138
150
'matchCondition ' => 'match_phrase_prefix ' ,
151
+ 'boost ' => 10
139
152
],
140
153
]
141
154
]
You can’t perform that action at this time.
0 commit comments