Skip to content

Commit 7d65495

Browse files
committed
ACP2E-464: Remove wildcard and LIKE operator and replace with equal operator in customer grid filter search
1 parent 5e33bc5 commit 7d65495

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

app/code/Magento/Customer/Test/Unit/Model/Indexer/AttributeProviderTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testAddDynamicData()
7373
/** @var Attribute|MockObject $attribute */
7474
$attribute = $this->getMockBuilder(Attribute::class)
7575
->disableOriginalConstructor()
76-
->setMethods(
76+
->onlyMethods(
7777
[
7878
'setEntity',
7979
'getName',
@@ -137,6 +137,7 @@ public function testAddDynamicData()
137137
'dataType' => $attrBackendType,
138138
'entity' => Customer::ENTITY,
139139
'bind' => null,
140+
'index' => false
140141
],
141142
],
142143
],
@@ -175,7 +176,7 @@ public function testAddDynamicDataWithStaticAndSearchable()
175176
/** @var Attribute|MockObject $attribute */
176177
$attribute = $this->getMockBuilder(Attribute::class)
177178
->disableOriginalConstructor()
178-
->setMethods(
179+
->onlyMethods(
179180
[
180181
'setEntity',
181182
'getName',
@@ -213,8 +214,12 @@ public function testAddDynamicDataWithStaticAndSearchable()
213214
$attribute->expects($this->any())
214215
->method('canBeSearchableInGrid')
215216
->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);
218223

219224
$this->assertEquals(
220225
['fields' => [
@@ -225,6 +230,7 @@ public function testAddDynamicDataWithStaticAndSearchable()
225230
'type' => 'searchable',
226231
'filters' => ['filter'],
227232
'dataType' => 'data_type',
233+
'index' => false
228234
],
229235
],
230236
],
@@ -273,7 +279,7 @@ public function testAddDynamicDataWithStaticAndFilterable()
273279
/** @var Attribute|MockObject $attribute */
274280
$attribute = $this->getMockBuilder(Attribute::class)
275281
->disableOriginalConstructor()
276-
->setMethods(
282+
->onlyMethods(
277283
[
278284
'setEntity',
279285
'getName',
@@ -336,6 +342,7 @@ public function testAddDynamicDataWithStaticAndFilterable()
336342
'dataType' => 'varchar',
337343
'entity' => Customer::ENTITY,
338344
'bind' => 'to_field',
345+
'index' => false
339346
],
340347
],
341348
'references' => [

0 commit comments

Comments
 (0)