File tree Expand file tree Collapse file tree 2 files changed +12
-34
lines changed
app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper Expand file tree Collapse file tree 2 files changed +12
-34
lines changed Original file line number Diff line number Diff line change 8
8
namespace Magento \Elasticsearch6 \Test \Unit \Model \Adapter \FieldMapper ;
9
9
10
10
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 ;
12
13
13
14
/**
14
15
* Test mapping preprocessor AddDefaultSearchField
15
16
*/
16
- class AddDefaultSearchFieldTest extends BaseTestCase
17
+ class AddDefaultSearchFieldTest extends TestCase
17
18
{
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
-
32
19
/**
33
20
* Test default search field "_search" should be prepended and overwrite if exist.
34
21
*
@@ -38,7 +25,9 @@ protected function setUp()
38
25
*/
39
26
public function testProcess (array $ mappingBefore , array $ mappingAfter )
40
27
{
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 ));
42
31
}
43
32
44
33
/**
Original file line number Diff line number Diff line change 8
8
namespace Magento \Elasticsearch6 \Test \Unit \Model \Adapter \FieldMapper ;
9
9
10
10
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 ;
12
13
13
14
/**
14
15
* Test mapping preprocessor CopySearchableFieldsToSearchField
15
16
*/
16
- class CopySearchableFieldsToSearchFieldTest extends BaseTestCase
17
+ class CopySearchableFieldsToSearchFieldTest extends TestCase
17
18
{
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
-
32
19
/**
33
20
* Test "copy_to" parameter should be added to searchable fields.
34
21
*
@@ -38,7 +25,9 @@ protected function setUp()
38
25
*/
39
26
public function testProcess (array $ mappingBefore , array $ mappingAfter )
40
27
{
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 ));
42
31
}
43
32
44
33
/**
You can’t perform that action at this time.
0 commit comments