From 4217dc46ca3ebfc903e817c9ed8141bfb58417ae Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 3 Oct 2024 13:19:54 +0700 Subject: [PATCH] [ticket/17391] Add simple functional test PHPBB-17391 --- tests/functional/acp_groups_test.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/functional/acp_groups_test.php b/tests/functional/acp_groups_test.php index 20f1271011..34cb16b99a 100644 --- a/tests/functional/acp_groups_test.php +++ b/tests/functional/acp_groups_test.php @@ -123,4 +123,20 @@ class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_te $this->assertEquals((bool) $tick_teampage, (bool) ($this->form_data['group_teampage'] ?? false)); } } + + public function test_acp_groups_create_existing_name() + { + $this->group_manage_login(); + + $crawler = self::request('GET', 'adm/index.php?i=groups&mode=manage&sid=' . $this->sid); + $form = $crawler->selectButton($this->lang('SUBMIT'))->form([ + 'group_name' => 'Guests', // 'Guests' is the group name already in use for predefined Guests group + ]); + + $crawler = self::submit($form); + $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); + $crawler = self::submit($form); // Just submit the form with selected group name + + $this->assertStringContainsString($this->lang('GROUP_NAME_TAKEN'), $crawler->text()); + } }