aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2020-01-04 14:21:58 +0100
committerMarc Alexander <admin@m-a-styles.de>2020-01-04 21:51:44 +0100
commit1b8193ab8b2c73d4a38520c206816817db168447 (patch)
tree7f0842d90b52cb926d15cc1df1dde77a2972d586 /tests/functional
parentb83de54bb4fd3217b41f61de896e73732752d196 (diff)
parented9cbc89c19bc6321bfdd540f241683b71ea9a6e (diff)
downloadforums-1b8193ab8b2c73d4a38520c206816817db168447.tar
forums-1b8193ab8b2c73d4a38520c206816817db168447.tar.gz
forums-1b8193ab8b2c73d4a38520c206816817db168447.tar.bz2
forums-1b8193ab8b2c73d4a38520c206816817db168447.tar.xz
forums-1b8193ab8b2c73d4a38520c206816817db168447.zip
Merge branch '3.2.x' into 3.3.x
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/ucp_groups_test.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/functional/ucp_groups_test.php b/tests/functional/ucp_groups_test.php
index cd18a0fcae..445c124158 100644
--- a/tests/functional/ucp_groups_test.php
+++ b/tests/functional/ucp_groups_test.php
@@ -54,4 +54,72 @@ class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_te
$this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
$this->assertEquals($teampage_settings, $this->get_teampage_settings());
}
+
+ public function test_create_request_group()
+ {
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/groups');
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_groups&mode=manage&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form, array('group_name' => 'request-group'));
+
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form, array('group_name' => 'request-group'));
+
+ $this->assertContainsLang('GROUP_CREATED', $crawler->filter('#main')->text());
+
+ $group_id = $this->get_group_id('request-group');
+
+ // Make admin group leader
+ $crawler = self::request('GET', 'adm/index.php?i=acp_groups&mode=manage&action=list&g=' . $group_id . '&sid=' . $this->sid);
+ $form = $crawler->filter('input[name=addusers]')->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form, [
+ 'leader' => 1,
+ 'usernames' => 'admin',
+ ]);
+
+ $this->assertContainsLang('GROUP_MODS_ADDED', $crawler->filter('#main')->text());
+ }
+
+ /**
+ * @depends test_create_request_group
+ */
+ public function test_request_group_membership()
+ {
+ $this->create_user('request-group-user');
+ $this->login('request-group-user');
+ $this->add_lang('groups');
+
+ $group_id = $this->get_group_id('request-group');
+
+ $crawler = self::request('GET', 'ucp.php?i=ucp_groups&mode=membership&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form, ['selected' => $group_id, 'action' => 'join']);
+ $this->assertContainsLang('GROUP_JOIN_PENDING_CONFIRM', $crawler->text());
+
+ $form = $crawler->selectButton($this->lang('YES'))->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('GROUP_JOINED_PENDING', $crawler->text());
+ }
+
+ /**
+ * @depends test_request_group_membership
+ */
+ public function test_approve_group_membership()
+ {
+ $this->login();
+ $this->add_lang('acp/groups');
+
+ $group_id = $this->get_group_id('request-group');
+ $crawler = self::request('GET', 'ucp.php?i=ucp_groups&mode=manage&action=list&g=' . $group_id . '&sid=' . $this->sid);
+ $form = $crawler->filter('input[name=update]')->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form, [
+ 'mark' => [$crawler->filter('input[name="mark[]"]')->first()->attr('value')],
+ 'action' => 'approve',
+ ]);
+
+ $this->assertContainsLang('USERS_APPROVED', $crawler->text());
+ }
}