10
10
11
11
class ReplicaIndexingTest extends IndexingTestCase
12
12
{
13
- protected ?ReplicaManagerInterface $ replicaManager ;
14
- protected ?ProductIndexer $ productIndexer ;
13
+ protected ?ReplicaManagerInterface $ replicaManager = null ;
14
+ protected ?ProductIndexer $ productIndexer = null ;
15
15
16
- protected ?IndicesConfigurator $ indicesConfigurator ;
16
+ protected ?IndicesConfigurator $ indicesConfigurator = null ;
17
17
18
- protected ?string $ indexSuffix ;
18
+ protected ?string $ indexSuffix = null ;
19
19
20
- protected ?array $ ogSortingState ;
20
+ protected ?array $ ogSortingState = null ;
21
21
22
22
public function setUp (): void
23
23
{
@@ -107,6 +107,7 @@ function($replica) use ($sortIndexName) {
107
107
108
108
/**
109
109
* @magentoDbIsolation disabled
110
+ * @group virtual
110
111
*/
111
112
public function testVirtualReplicaConfig (): void
112
113
{
@@ -124,33 +125,13 @@ public function testVirtualReplicaConfig(): void
124
125
'sort ' => $ sortDir ,
125
126
'sortLabel ' => $ sortAttr
126
127
];
127
- $ encoded = json_encode ($ sorting );
128
- // $this->setConfig('algoliasearch_instant/instant_sorts/sorts', $encoded);
129
128
$ this ->configHelper ->setSorting ($ sorting );
130
129
131
- $ connection = $ this ->objectManager ->create (\Magento \Framework \App \ResourceConnection::class)
132
- ->getConnection ();
133
- // $connection->beginTransaction();
134
- // $this->objectManager->get(\Magento\Framework\App\Config\Storage\WriterInterface::class)->save(
135
- // \Algolia\AlgoliaSearch\Helper\ConfigHelper::SORTING_INDICES,
136
- // $encoded,
137
- // 'default'
138
- // );
139
- // $connection->commit();
130
+ $ this ->assertConfigInDb ('algoliasearch_instant/instant_sorts/sorts ' , json_encode ($ sorting ));
140
131
132
+ $ this ->refreshConfigFromDb ();
141
133
142
- $ select = $ connection ->select ()
143
- ->from ('core_config_data ' , 'value ' )
144
- ->where ('path = ? ' , 'algoliasearch_instant/instant_sorts/sorts ' )
145
- ->where ('scope = ? ' , 'default ' )
146
- ->where ('scope_id = ? ' , 0 );
147
-
148
- $ configValue = $ connection ->fetchOne ($ select );
149
-
150
- // Assert that the correct value was written to the database
151
- $ this ->assertEquals ($ encoded , $ configValue );
152
-
153
- // $this->assertSortingAttribute($sortAttr, $sortDir);
134
+ $ this ->assertSortingAttribute ($ sortAttr , $ sortDir );
154
135
155
136
}
156
137
0 commit comments