aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/ucp_groups_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-06-04 20:26:35 +0200
committerMarc Alexander <admin@m-a-styles.de>2013-06-04 20:35:55 +0200
commit495b22632c489f08c46f6712f917e920911e5759 (patch)
tree9203347c7acfe12bb4993837be8bf35e31046e2b /tests/functional/ucp_groups_test.php
parent0aa964786d8a6fc677ebd62cd7533fa3bf045730 (diff)
downloadforums-495b22632c489f08c46f6712f917e920911e5759.tar
forums-495b22632c489f08c46f6712f917e920911e5759.tar.gz
forums-495b22632c489f08c46f6712f917e920911e5759.tar.bz2
forums-495b22632c489f08c46f6712f917e920911e5759.tar.xz
forums-495b22632c489f08c46f6712f917e920911e5759.zip
[ticket/11587] Add functional tests for group teampage settings
The group_legend and group_teampage settings, which are needed for the teampage, are tested with these newly added functional tests. Duplicate code has been reduced as much as possible. PHPBB3-11587
Diffstat (limited to 'tests/functional/ucp_groups_test.php')
-rw-r--r--tests/functional/ucp_groups_test.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/functional/ucp_groups_test.php b/tests/functional/ucp_groups_test.php
index 9c6b1edc5e..a804d8f601 100644
--- a/tests/functional/ucp_groups_test.php
+++ b/tests/functional/ucp_groups_test.php
@@ -14,8 +14,40 @@ require_once dirname(__FILE__) . '/common_groups_test.php';
*/
class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_test
{
+ protected $db;
+
protected function get_url()
{
return 'ucp.php?i=groups&mode=manage&action=edit';
}
+
+ protected function get_teampage_settings()
+ {
+ if (!isset($this->db))
+ {
+ $this->db = $this->get_db();
+ }
+ $sql = 'SELECT g.group_legend AS group_legend, t.teampage_position AS group_teampage
+ FROM ' . GROUPS_TABLE . ' g
+ LEFT JOIN ' . TEAMPAGE_TABLE . ' t
+ ON (t.group_id = g.group_id)
+ WHERE g.group_id = 5';
+ $result = $this->db->sql_query($sql);
+ $group_row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+ return $group_row;
+ }
+
+ public function test_ucp_groups_teampage()
+ {
+ $this->group_manage_login();
+
+ // Test if group_legend or group_teampage are modified while
+ // submitting the ucp_group_manage page
+ $form = $this->get_group_manage_form();
+ $teampage_settings = $this->get_teampage_settings();
+ $crawler = $this->client->submit($form);
+ $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
+ $this->assertEquals($teampage_settings, $this->get_teampage_settings());
+ }
}