Skip to content

Commit

Permalink
Add functional test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxu committed Jan 11, 2024
1 parent 45aecb2 commit a092642
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/functional/functional_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a092642

Please sign in to comment.