@@ -60,11 +60,15 @@ protected function tearDown(): void {
6060 $ this ->appConfig ->deleteApp (TestLexicon_N::APPID );
6161 $ this ->appConfig ->deleteApp (TestLexicon_W::APPID );
6262 $ this ->appConfig ->deleteApp (TestLexicon_E::APPID );
63+ $ this ->appConfig ->deleteApp (TestLexicon_UserIndexed::APPID );
64+ $ this ->appConfig ->deleteApp (TestLexicon_UserIndexedRemove::APPID );
6365
6466 $ this ->userConfig ->deleteApp (TestConfigLexicon_I::APPID );
6567 $ this ->userConfig ->deleteApp (TestLexicon_N::APPID );
6668 $ this ->userConfig ->deleteApp (TestLexicon_W::APPID );
6769 $ this ->userConfig ->deleteApp (TestLexicon_E::APPID );
70+ $ this ->userConfig ->deleteApp (TestLexicon_UserIndexed::APPID );
71+ $ this ->userConfig ->deleteApp (TestLexicon_UserIndexedRemove::APPID );
6872 }
6973
7074 public function testAppLexiconSetCorrect () {
@@ -234,4 +238,50 @@ public function testUserConfigLexiconPresets() {
234238 $ this ->presetManager ->setLexiconPreset (Preset::FAMILY );
235239 $ this ->assertSame ('family ' , $ this ->userConfig ->getValueString ('user1 ' , TestLexicon_E::APPID , 'key3 ' ));
236240 }
241+
242+ public function testLexiconIndexedUpdate () {
243+ $ this ->userConfig ->setValueString ('user1 ' , TestLexicon_UserIndexed::APPID , 'key1 ' , 'abcd ' );
244+ $ this ->userConfig ->setValueString ('user2 ' , TestLexicon_UserIndexed::APPID , 'key1 ' , '1234 ' , flags: 64 );
245+ $ this ->userConfig ->setValueString ('user3 ' , TestLexicon_UserIndexed::APPID , 'key1 ' , 'qwer ' , flags: IUserConfig::FLAG_INDEXED );
246+ $ this ->userConfig ->setValueString ('user4 ' , TestLexicon_UserIndexed::APPID , 'key1 ' , 'uiop ' , flags: 64 | IUserConfig::FLAG_INDEXED );
247+
248+ $ bootstrapCoordinator = Server::get (Coordinator::class);
249+ $ bootstrapCoordinator ->getRegistrationContext ()?->registerConfigLexicon(TestLexicon_UserIndexed::APPID , TestLexicon_UserIndexed::class);
250+ $ this ->userConfig ->clearCacheAll ();
251+
252+ $ this ->configManager ->updateLexiconEntries (TestLexicon_UserIndexed::APPID );
253+
254+ $ this ->assertTrue ($ this ->userConfig ->isIndexed ('user1 ' , TestLexicon_UserIndexed::APPID , 'key1 ' ));
255+ $ this ->assertTrue ($ this ->userConfig ->isIndexed ('user2 ' , TestLexicon_UserIndexed::APPID , 'key1 ' ));
256+ $ this ->assertTrue ($ this ->userConfig ->isIndexed ('user3 ' , TestLexicon_UserIndexed::APPID , 'key1 ' ));
257+ $ this ->assertTrue ($ this ->userConfig ->isIndexed ('user4 ' , TestLexicon_UserIndexed::APPID , 'key1 ' ));
258+
259+ $ this ->assertSame (2 , $ this ->userConfig ->getValueFlags ('user1 ' , TestLexicon_UserIndexed::APPID , 'key1 ' ));
260+ $ this ->assertSame (66 , $ this ->userConfig ->getValueFlags ('user2 ' , TestLexicon_UserIndexed::APPID , 'key1 ' ));
261+ $ this ->assertSame (2 , $ this ->userConfig ->getValueFlags ('user3 ' , TestLexicon_UserIndexed::APPID , 'key1 ' ));
262+ $ this ->assertSame (66 , $ this ->userConfig ->getValueFlags ('user4 ' , TestLexicon_UserIndexed::APPID , 'key1 ' ));
263+ }
264+
265+ public function testLexiconIndexedUpdateRemove () {
266+ $ this ->userConfig ->setValueString ('user1 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' , 'abcd ' );
267+ $ this ->userConfig ->setValueString ('user2 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' , '1234 ' , flags: 64 );
268+ $ this ->userConfig ->setValueString ('user3 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' , 'qwer ' , flags: IUserConfig::FLAG_INDEXED );
269+ $ this ->userConfig ->setValueString ('user4 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' , 'uiop ' , flags: 64 | IUserConfig::FLAG_INDEXED );
270+
271+ $ bootstrapCoordinator = Server::get (Coordinator::class);
272+ $ bootstrapCoordinator ->getRegistrationContext ()?->registerConfigLexicon(TestLexicon_UserIndexedRemove::APPID , TestLexicon_UserIndexedRemove::class);
273+ $ this ->userConfig ->clearCacheAll ();
274+
275+ $ this ->configManager ->updateLexiconEntries (TestLexicon_UserIndexedRemove::APPID );
276+
277+ $ this ->assertFalse ($ this ->userConfig ->isIndexed ('user1 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' ));
278+ $ this ->assertFalse ($ this ->userConfig ->isIndexed ('user2 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' ));
279+ $ this ->assertFalse ($ this ->userConfig ->isIndexed ('user3 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' ));
280+ $ this ->assertFalse ($ this ->userConfig ->isIndexed ('user4 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' ));
281+
282+ $ this ->assertSame (0 , $ this ->userConfig ->getValueFlags ('user1 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' ));
283+ $ this ->assertSame (64 , $ this ->userConfig ->getValueFlags ('user2 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' ));
284+ $ this ->assertSame (0 , $ this ->userConfig ->getValueFlags ('user3 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' ));
285+ $ this ->assertSame (64 , $ this ->userConfig ->getValueFlags ('user4 ' , TestLexicon_UserIndexedRemove::APPID , 'key1 ' ));
286+ }
237287}
0 commit comments