@@ -73,7 +73,7 @@ public function testAddDynamicData()
73
73
/** @var Attribute|MockObject $attribute */
74
74
$ attribute = $ this ->getMockBuilder (Attribute::class)
75
75
->disableOriginalConstructor ()
76
- ->setMethods (
76
+ ->onlyMethods (
77
77
[
78
78
'setEntity ' ,
79
79
'getName ' ,
@@ -137,6 +137,7 @@ public function testAddDynamicData()
137
137
'dataType ' => $ attrBackendType ,
138
138
'entity ' => Customer::ENTITY ,
139
139
'bind ' => null ,
140
+ 'index ' => false
140
141
],
141
142
],
142
143
],
@@ -175,7 +176,7 @@ public function testAddDynamicDataWithStaticAndSearchable()
175
176
/** @var Attribute|MockObject $attribute */
176
177
$ attribute = $ this ->getMockBuilder (Attribute::class)
177
178
->disableOriginalConstructor ()
178
- ->setMethods (
179
+ ->onlyMethods (
179
180
[
180
181
'setEntity ' ,
181
182
'getName ' ,
@@ -213,8 +214,12 @@ public function testAddDynamicDataWithStaticAndSearchable()
213
214
$ attribute ->expects ($ this ->any ())
214
215
->method ('canBeSearchableInGrid ' )
215
216
->willReturn (true );
216
- $ attribute ->expects ($ this ->never ())
217
- ->method ('canBeFilterableInGrid ' );
217
+ $ attribute ->expects ($ this ->once ())
218
+ ->method ('canBeFilterableInGrid ' )
219
+ ->willReturn (false );
220
+ $ attribute ->expects ($ this ->once ())
221
+ ->method ('getName ' )
222
+ ->willReturn ($ attrName );
218
223
219
224
$ this ->assertEquals (
220
225
['fields ' => [
@@ -225,6 +230,7 @@ public function testAddDynamicDataWithStaticAndSearchable()
225
230
'type ' => 'searchable ' ,
226
231
'filters ' => ['filter ' ],
227
232
'dataType ' => 'data_type ' ,
233
+ 'index ' => false
228
234
],
229
235
],
230
236
],
@@ -273,7 +279,7 @@ public function testAddDynamicDataWithStaticAndFilterable()
273
279
/** @var Attribute|MockObject $attribute */
274
280
$ attribute = $ this ->getMockBuilder (Attribute::class)
275
281
->disableOriginalConstructor ()
276
- ->setMethods (
282
+ ->onlyMethods (
277
283
[
278
284
'setEntity ' ,
279
285
'getName ' ,
@@ -336,6 +342,7 @@ public function testAddDynamicDataWithStaticAndFilterable()
336
342
'dataType ' => 'varchar ' ,
337
343
'entity ' => Customer::ENTITY ,
338
344
'bind ' => 'to_field ' ,
345
+ 'index ' => false
339
346
],
340
347
],
341
348
'references ' => [
0 commit comments