From a092642e2a102368b918751d375a11367b0a089a Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 8 Jan 2024 19:57:01 +0700 Subject: [PATCH] Add functional test case. --- tests/functional/functional_test.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/functional/functional_test.php b/tests/functional/functional_test.php index 12b6ef7..a827846 100644 --- a/tests/functional/functional_test.php +++ b/tests/functional/functional_test.php @@ -62,6 +62,24 @@ public function test_acp_module() } } + public function test_acp_enabling_webpush_for_all_users() + { + $this->login(); + $this->admin_login(); + + $this->add_lang_ext('phpbb/webpushnotifications', ['info_acp_webpushnotifications', 'webpushnotifications_module_acp']); + + $crawler = self::request('GET', 'adm/index.php?i=-phpbb-webpushnotifications-acp-wpn_acp_module&mode=webpush&sid=' . $this->sid); + + $this->assertContainsLang('WEBPUSH_ENABLE_FOR_ALL_USERS', $crawler->filter('dt')->eq(3)->filter('label')->text()); + $this->assertContainsLang('WEBPUSH_ENABLE_FOR_ALL_USERS_EXPLAIN', $crawler->filter('dt')->eq(3)->filter('span')->text()); + $this->assertContainsLang('WEBPUSH_ENABLE_FOR_ALL_USERS', $crawler->filter('input.button2')->eq(1)->attr('value')); + + $form = $crawler->selectButton('webpush_enable_for_all_users')->form(); + $crawler = self::submit($form); + $this->assertStringContainsString($this->lang('WEBPUSH_ENABLED_FOR_ALL_USERS'), $crawler->filter('.successbox')->text()); + } + public function test_ucp_module() { $this->login();