Skip to content

Commit 9c9be75

Browse files
committed
MAGETWO-95294: Mysql search slow on the catalog page
- changes after merge
1 parent c732b5d commit 9c9be75

File tree

1 file changed

+13
-8
lines changed
  • app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/Product/FieldProvider/FieldName/Resolver

1 file changed

+13
-8
lines changed

app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/Product/FieldProvider/FieldName/Resolver/DefaultResolverTest.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ protected function setUp()
6666
* @param $fieldType
6767
* @param $attributeCode
6868
* @param $frontendInput
69+
* @param $isSortable
6970
* @param $context
7071
* @param $expected
7172
* @return void
@@ -74,6 +75,7 @@ public function testGetFieldName(
7475
$fieldType,
7576
$attributeCode,
7677
$frontendInput,
78+
$isSortable,
7779
$context,
7880
$expected
7981
) {
@@ -82,14 +84,17 @@ public function testGetFieldName(
8284
->willReturn('string');
8385
$attributeMock = $this->getMockBuilder(AttributeAdapter::class)
8486
->disableOriginalConstructor()
85-
->setMethods(['getAttributeCode', 'getFrontendInput'])
87+
->setMethods(['getAttributeCode', 'getFrontendInput', 'isSortable'])
8688
->getMock();
8789
$attributeMock->expects($this->any())
8890
->method('getAttributeCode')
8991
->willReturn($attributeCode);
9092
$attributeMock->expects($this->any())
9193
->method('getFrontendInput')
9294
->willReturn($frontendInput);
95+
$attributeMock->expects($this->any())
96+
->method('isSortable')
97+
->willReturn($isSortable);
9398
$this->fieldTypeResolver->expects($this->any())
9499
->method('getFieldType')
95100
->willReturn($fieldType);
@@ -106,13 +111,13 @@ public function testGetFieldName(
106111
public function getFieldNameProvider()
107112
{
108113
return [
109-
['', 'code', '', [], 'code'],
110-
['', 'code', '', ['type' => 'default'], 'code'],
111-
['string', '*', '', ['type' => 'default'], '_search'],
112-
['', 'code', '', ['type' => 'default'], 'code'],
113-
['', 'code', 'select', ['type' => 'default'], 'code'],
114-
['', 'code', 'boolean', ['type' => 'default'], 'code'],
115-
['', 'code', '', ['type' => 'type'], 'sort_code'],
114+
['', 'code', '', false, [], 'code'],
115+
['', 'code', '', false, ['type' => 'default'], 'code'],
116+
['string', '*', '', false, ['type' => 'default'], '_search'],
117+
['', 'code', '', false, ['type' => 'default'], 'code'],
118+
['', 'code', 'select', false, ['type' => 'default'], 'code'],
119+
['', 'code', 'boolean', false, ['type' => 'default'], 'code'],
120+
['', 'code', '', true, ['type' => 'sort'], 'sort_code'],
116121
];
117122
}
118123
}

0 commit comments

Comments
 (0)