Skip to content

Commit 2314bd3

Browse files
committed
MC-21807: Implement control over minimum_should_match for elasticsearch queries
- Fix Magento-Health-Index-PR build failures
1 parent e297de5 commit 2314bd3

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed

app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,14 @@
88
namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper;
99

1010
use Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField;
11-
use Magento\Framework\TestFramework\Unit\BaseTestCase;
11+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
12+
use PHPUnit\Framework\TestCase;
1213

1314
/**
1415
* Test mapping preprocessor AddDefaultSearchField
1516
*/
16-
class AddDefaultSearchFieldTest extends BaseTestCase
17+
class AddDefaultSearchFieldTest extends TestCase
1718
{
18-
/**
19-
* @var AddDefaultSearchField
20-
*/
21-
private $model;
22-
23-
/**
24-
* @inheritDoc
25-
*/
26-
protected function setUp()
27-
{
28-
parent::setUp();
29-
$this->model = $this->objectManager->getObject(AddDefaultSearchField::class);
30-
}
31-
3219
/**
3320
* Test default search field "_search" should be prepended and overwrite if exist.
3421
*
@@ -38,7 +25,9 @@ protected function setUp()
3825
*/
3926
public function testProcess(array $mappingBefore, array $mappingAfter)
4027
{
41-
$this->assertEquals($mappingAfter, $this->model->process($mappingBefore));
28+
$objectManager = new ObjectManager($this);
29+
$model = $objectManager->getObject(AddDefaultSearchField::class);
30+
$this->assertEquals($mappingAfter, $model->process($mappingBefore));
4231
}
4332

4433
/**

app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,14 @@
88
namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper;
99

1010
use Magento\Elasticsearch6\Model\Adapter\FieldMapper\CopySearchableFieldsToSearchField;
11-
use Magento\Framework\TestFramework\Unit\BaseTestCase;
11+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
12+
use PHPUnit\Framework\TestCase;
1213

1314
/**
1415
* Test mapping preprocessor CopySearchableFieldsToSearchField
1516
*/
16-
class CopySearchableFieldsToSearchFieldTest extends BaseTestCase
17+
class CopySearchableFieldsToSearchFieldTest extends TestCase
1718
{
18-
/**
19-
* @var CopySearchableFieldsToSearchField
20-
*/
21-
private $model;
22-
23-
/**
24-
* @inheritDoc
25-
*/
26-
protected function setUp()
27-
{
28-
parent::setUp();
29-
$this->model = $this->objectManager->getObject(CopySearchableFieldsToSearchField::class);
30-
}
31-
3219
/**
3320
* Test "copy_to" parameter should be added to searchable fields.
3421
*
@@ -38,7 +25,9 @@ protected function setUp()
3825
*/
3926
public function testProcess(array $mappingBefore, array $mappingAfter)
4027
{
41-
$this->assertEquals($mappingAfter, $this->model->process($mappingBefore));
28+
$objectManager = new ObjectManager($this);
29+
$model = $objectManager->getObject(CopySearchableFieldsToSearchField::class);
30+
$this->assertEquals($mappingAfter, $model->process($mappingBefore));
4231
}
4332

4433
/**

0 commit comments

Comments
 (0)