@@ -149,6 +149,7 @@ public function test_getSubscribedEvents()
149
149
'core.ucp_display_module_before ' ,
150
150
'core.acp_main_notice ' ,
151
151
'core.acp_board_config_edit_add ' ,
152
+ 'core.acp_board_config_emoji_enabled ' ,
152
153
'core.validate_config_variable ' ,
153
154
'core.help_manager_add_block_after ' ,
154
155
], array_keys (\phpbb \webpushnotifications \event \listener::getSubscribedEvents ()));
@@ -376,7 +377,6 @@ public function test_acp_pwa_options($mode, $display_vars, $expected_keys)
376
377
$ keys = array_keys ($ display_vars ['vars ' ]);
377
378
378
379
self ::assertEquals ($ expected_keys , $ keys );
379
-
380
380
}
381
381
382
382
public function validate_pwa_options_data ()
@@ -420,6 +420,21 @@ public function validate_pwa_options_data()
420
420
[
421
421
'pwa_options:string ' ,
422
422
['pwa_short_name ' => 'foo❤️ ' ],
423
+ [],
424
+ ],
425
+ [
426
+ 'pwa_options:string ' ,
427
+ ['pwa_short_name ' => 'Фаны phpBB ' ],
428
+ [],
429
+ ],
430
+ [
431
+ 'pwa_options:string ' ,
432
+ ['pwa_short_name ' => 'Фаны phpBB Board ' ],
433
+ ['PWA_SHORT_NAME_INVALID ' ],
434
+ ],
435
+ [
436
+ 'pwa_options:string ' ,
437
+ ['pwa_short_name ' => 'foo❤️bar foo bar ' ],
423
438
['PWA_SHORT_NAME_INVALID ' ],
424
439
],
425
440
[
@@ -472,6 +487,24 @@ public function test_validate_pwa_options($validate, $cfg_array, $expected_error
472
487
self ::assertEquals ($ expected_error , $ error );
473
488
}
474
489
490
+ public function test_acp_pwa_allow_emoji ()
491
+ {
492
+ $ config_name_ary = ['foo ' ];
493
+ $ expected = ['foo ' , 'pwa_short_name ' ];
494
+
495
+ $ this ->set_listener ();
496
+
497
+ $ dispatcher = new \phpbb \event \dispatcher ();
498
+ $ dispatcher ->addListener ('core.acp_board_config_emoji_enabled ' , [$ this ->listener , 'acp_pwa_allow_emoji ' ]);
499
+
500
+ $ event_data = ['config_name_ary ' ];
501
+ $ event_data_after = $ dispatcher ->trigger_event ('core.acp_board_config_emoji_enabled ' , compact ($ event_data ));
502
+
503
+ extract ($ event_data_after , EXTR_OVERWRITE );
504
+
505
+ self ::assertEquals ($ expected , $ config_name_ary );
506
+ }
507
+
475
508
public function test_wpn_faq ()
476
509
{
477
510
$ this ->language ->add_lang ('webpushnotifications_faq ' , 'phpbb/webpushnotifications ' );
0 commit comments