@@ -15,7 +15,7 @@ public function testFacets()
15
15
16
16
$ this ->algoliaHelper ->waitLastTask ();
17
17
18
- $ indexSettings = $ this ->algoliaHelper ->getIndex ($ this ->indexPrefix . 'default_products ' )-> getSettings ( );
18
+ $ indexSettings = $ this ->algoliaHelper ->getSettings ($ this ->indexPrefix . 'default_products ' );
19
19
20
20
$ this ->assertEquals ($ this ->assertValues ->attributesForFaceting , count ($ indexSettings ['attributesForFaceting ' ]));
21
21
}
@@ -28,18 +28,22 @@ public function testQueryRules()
28
28
29
29
$ this ->algoliaHelper ->waitLastTask ();
30
30
31
- $ index = $ this ->algoliaHelper ->getIndex ( $ this -> indexPrefix . ' default_products ' );
31
+ $ client = $ this ->algoliaHelper ->getClient ( );
32
32
33
33
$ matchedRules = [];
34
34
35
35
$ hitsPerPage = 100 ;
36
36
$ page = 0 ;
37
37
do {
38
- $ fetchedQueryRules = $ index ->searchRules ('' , [
39
- 'context ' => 'magento_filters ' ,
40
- 'page ' => $ page ,
41
- 'hitsPerPage ' => $ hitsPerPage ,
42
- ]);
38
+ $ fetchedQueryRules = $ client ->searchRules (
39
+ $ this ->indexPrefix . 'default_products ' ,
40
+ [
41
+ 'query ' => '' ,
42
+ 'context ' => 'magento_filters ' ,
43
+ 'page ' => $ page ,
44
+ 'hitsPerPage ' => $ hitsPerPage ,
45
+ ]
46
+ );
43
47
44
48
foreach ($ fetchedQueryRules ['hits ' ] as $ hit ) {
45
49
$ matchedRules [] = $ hit ;
@@ -75,7 +79,7 @@ public function testAutomaticalSetOfCategoriesFacet()
75
79
76
80
$ this ->algoliaHelper ->waitLastTask ();
77
81
78
- $ indexSettings = $ this ->algoliaHelper ->getIndex ($ this ->indexPrefix . 'default_products ' )-> getSettings ( );
82
+ $ indexSettings = $ this ->algoliaHelper ->getSettings ($ this ->indexPrefix . 'default_products ' );
79
83
80
84
$ this ->assertEquals ($ this ->assertValues ->automaticalSetOfCategoryAttributesForFaceting , count ($ indexSettings ['attributesForFaceting ' ]));
81
85
@@ -97,7 +101,7 @@ public function testAutomaticalSetOfCategoriesFacet()
97
101
98
102
$ this ->algoliaHelper ->waitLastTask ();
99
103
100
- $ indexSettings = $ this ->algoliaHelper ->getIndex ($ this ->indexPrefix . 'default_products ' )-> getSettings ( );
104
+ $ indexSettings = $ this ->algoliaHelper ->getSettings ($ this ->indexPrefix . 'default_products ' );
101
105
102
106
$ this ->assertEquals ($ this ->assertValues ->automaticalSetOfCategoryAttributesForFaceting + 1 , count ($ indexSettings ['attributesForFaceting ' ]));
103
107
@@ -224,7 +228,7 @@ public function testExtraSettings()
224
228
foreach ($ sections as $ section ) {
225
229
$ indexName = $ this ->indexPrefix . 'default_ ' . $ section ;
226
230
227
- $ currentSettings = $ this ->algoliaHelper ->getIndex ($ indexName)-> getSettings ( );
231
+ $ currentSettings = $ this ->algoliaHelper ->getSettings ($ indexName );
228
232
229
233
$ this ->assertArrayHasKey ('exactOnSingleWordQuery ' , $ currentSettings );
230
234
$ this ->assertEquals ('attribute ' , $ currentSettings ['exactOnSingleWordQuery ' ]);
@@ -240,7 +244,7 @@ public function testExtraSettings()
240
244
foreach ($ sections as $ section ) {
241
245
$ indexName = $ this ->indexPrefix . 'default_ ' . $ section ;
242
246
243
- $ currentSettings = $ this ->algoliaHelper ->getIndex ($ indexName)-> getSettings ( );
247
+ $ currentSettings = $ this ->algoliaHelper ->getSettings ($ indexName );
244
248
245
249
$ this ->assertArrayHasKey ('exactOnSingleWordQuery ' , $ currentSettings );
246
250
$ this ->assertEquals ('word ' , $ currentSettings ['exactOnSingleWordQuery ' ]);
0 commit comments