From 0a5988ec1f3d72afb17b87d6cd74f60b646bae42 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 17 May 2013 12:32:09 +0200 Subject: [ticket/11538] Use abstract class for functional test cases for group colour PHPBB3-11538 --- tests/functional/common_groups_test.php | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/functional/common_groups_test.php (limited to 'tests/functional/common_groups_test.php') diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php new file mode 100644 index 0000000000..3061bf7510 --- /dev/null +++ b/tests/functional/common_groups_test.php @@ -0,0 +1,50 @@ +login(); + $this->admin_login(); + $this->add_lang(array('ucp', 'acp/groups')); + + $crawler = $this->request('GET', $this->get_url() . '&sid=' . $this->sid); + $this->assert_response_success(); + $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); + $form['group_colour']->setValue($input); + $crawler = $this->client->submit($form); + $this->assertContains($this->lang($expected), $crawler->text()); + } +} -- cgit v1.2.1 From 8aea2b382dcb57f67704dec5194378d9a76c127e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 19 May 2013 11:44:26 +0200 Subject: [ticket/11538] Move group ID into abstract test class and add more test cases The group ID is defined in the abstract class now and additional test cases for hex colour values have been added. PHPBB3-11538 --- tests/functional/common_groups_test.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/functional/common_groups_test.php') diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php index 3061bf7510..985dbc9220 100644 --- a/tests/functional/common_groups_test.php +++ b/tests/functional/common_groups_test.php @@ -20,6 +20,7 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test array('#AA0000', 'WRONG_DATA_COLOUR'), array('AA0000', 'GROUP_UPDATED'), array('AA0000v', 'WRONG_DATA_COLOUR'), + array('AA00000', 'WRONG_DATA_COLOUR'), array('vAA0000', 'WRONG_DATA_COLOUR'), array('AAG000','WRONG_DATA_COLOUR'), array('a00', 'GROUP_UPDATED'), @@ -28,6 +29,8 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test array('AA0000 ', 'GROUP_UPDATED'), array('AA0000 abf', 'WRONG_DATA_COLOUR'), array('AA0000 AA0000', 'WRONG_DATA_COLOUR'), + array('000 ', 'GROUP_UPDATED'), + array('000000 ', 'GROUP_UPDATED'), ); } @@ -40,7 +43,8 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test $this->admin_login(); $this->add_lang(array('ucp', 'acp/groups')); - $crawler = $this->request('GET', $this->get_url() . '&sid=' . $this->sid); + // Manage Administrators group + $crawler = $this->request('GET', $this->get_url() . '&g=5&sid=' . $this->sid); $this->assert_response_success(); $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); $form['group_colour']->setValue($input); -- cgit v1.2.1 From e49b4543de7c18df7e9b5c70ef5064cc4de9934a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 19 May 2013 15:17:47 +0200 Subject: [ticket/11538] Modify test colour values PHPBB3-11538 --- tests/functional/common_groups_test.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/functional/common_groups_test.php') diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php index 985dbc9220..02a538d46e 100644 --- a/tests/functional/common_groups_test.php +++ b/tests/functional/common_groups_test.php @@ -29,8 +29,9 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test array('AA0000 ', 'GROUP_UPDATED'), array('AA0000 abf', 'WRONG_DATA_COLOUR'), array('AA0000 AA0000', 'WRONG_DATA_COLOUR'), - array('000 ', 'GROUP_UPDATED'), - array('000000 ', 'GROUP_UPDATED'), + array('', 'GROUP_UPDATED'), + array('000', 'GROUP_UPDATED'), + array('000000', 'GROUP_UPDATED'), ); } -- cgit v1.2.1 From 3faae5c98cfe9d3b6245a892808aee19bc9c1fcc Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 26 May 2013 17:55:23 +0200 Subject: [ticket/11538] Cut functional tests down a bit as these are more expensive. PHPBB3-11538 --- tests/functional/common_groups_test.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'tests/functional/common_groups_test.php') diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php index 02a538d46e..7ccd78421e 100644 --- a/tests/functional/common_groups_test.php +++ b/tests/functional/common_groups_test.php @@ -17,21 +17,11 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test public function groups_manage_test_data() { return array( - array('#AA0000', 'WRONG_DATA_COLOUR'), - array('AA0000', 'GROUP_UPDATED'), - array('AA0000v', 'WRONG_DATA_COLOUR'), - array('AA00000', 'WRONG_DATA_COLOUR'), - array('vAA0000', 'WRONG_DATA_COLOUR'), - array('AAG000','WRONG_DATA_COLOUR'), - array('a00', 'GROUP_UPDATED'), - array('ag0', 'WRONG_DATA_COLOUR'), - array('#aa0', 'WRONG_DATA_COLOUR'), - array('AA0000 ', 'GROUP_UPDATED'), - array('AA0000 abf', 'WRONG_DATA_COLOUR'), - array('AA0000 AA0000', 'WRONG_DATA_COLOUR'), array('', 'GROUP_UPDATED'), - array('000', 'GROUP_UPDATED'), - array('000000', 'GROUP_UPDATED'), + array('aa0000', 'GROUP_UPDATED'), + + array('AAG000','WRONG_DATA_COLOUR'), + array('#AA0000', 'WRONG_DATA_COLOUR'), ); } -- cgit v1.2.1 From 9be57ec076eb1c819c6a6a51c4f2ba9f3e3c915d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 27 May 2013 22:33:48 +0200 Subject: [ticket/11568] Fix common_groups_test.php form handling PHPBB3-11568 --- tests/functional/common_groups_test.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/functional/common_groups_test.php') diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php index 7ccd78421e..6e1f1afdce 100644 --- a/tests/functional/common_groups_test.php +++ b/tests/functional/common_groups_test.php @@ -36,10 +36,9 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test // Manage Administrators group $crawler = $this->request('GET', $this->get_url() . '&g=5&sid=' . $this->sid); - $this->assert_response_success(); $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); $form['group_colour']->setValue($input); - $crawler = $this->client->submit($form); + $crawler = $this->submit($form); $this->assertContains($this->lang($expected), $crawler->text()); } } -- cgit v1.2.1 From b7b81f64316a900d6de308d4b65f89b7b4b58e2f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 31 May 2013 16:16:41 +0200 Subject: [ticket/11568] Use static calls for static methods PHPBB3-11568 --- tests/functional/common_groups_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/functional/common_groups_test.php') diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php index 6e1f1afdce..7c88ec900d 100644 --- a/tests/functional/common_groups_test.php +++ b/tests/functional/common_groups_test.php @@ -35,10 +35,10 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test $this->add_lang(array('ucp', 'acp/groups')); // Manage Administrators group - $crawler = $this->request('GET', $this->get_url() . '&g=5&sid=' . $this->sid); + $crawler = self::request('GET', $this->get_url() . '&g=5&sid=' . $this->sid); $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); $form['group_colour']->setValue($input); - $crawler = $this->submit($form); + $crawler = self::submit($form); $this->assertContains($this->lang($expected), $crawler->text()); } } -- cgit v1.2.1 From 71deb4dde7f0d92905c13b79c92b5ccc6beeb3c3 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 4 Jun 2013 17:16:22 +0200 Subject: [ticket/11538] Add admin as admins leader and moderator in memberlist_test Removing the admin user from the admin and moderator group in memberlist_test potentially breaks other tests, i.e. the ucp groups test. PHPBB3-11538 --- tests/functional/common_groups_test.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'tests/functional/common_groups_test.php') diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php index cc6afa54b9..7ccd78421e 100644 --- a/tests/functional/common_groups_test.php +++ b/tests/functional/common_groups_test.php @@ -30,12 +30,6 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test */ public function test_groups_manage($input, $expected) { - $this->markTestIncomplete( - 'Test fails on develop due to another test deleting the Administrators group.' - ); - // See https://github.com/phpbb/phpbb3/pull/1407#issuecomment-18465480 - // and https://gist.github.com/bantu/22dc4f6c6c0b8f9e0fa1 - $this->login(); $this->admin_login(); $this->add_lang(array('ucp', 'acp/groups')); -- cgit v1.2.1 From 495b22632c489f08c46f6712f917e920911e5759 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 4 Jun 2013 20:26:35 +0200 Subject: [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 --- tests/functional/common_groups_test.php | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'tests/functional/common_groups_test.php') diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php index 7ccd78421e..53f7ead29a 100644 --- a/tests/functional/common_groups_test.php +++ b/tests/functional/common_groups_test.php @@ -14,6 +14,30 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test { abstract protected function get_url(); + /** + * Get group_manage form + * @param int $group_id ID of the group that should be managed + */ + protected function get_group_manage_form($group_id = 5) + { + // Manage Administrators group + $crawler = $this->request('GET', $this->get_url() . "&g=$group_id&sid=" . $this->sid); + $this->assert_response_success(); + //var_export($this->client->getResponse()->getContent()); + $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); + return $form; + } + + /** + * Execute login calls and add_lang() calls for tests + */ + protected function group_manage_login() + { + $this->login(); + $this->admin_login(); + $this->add_lang(array('ucp', 'acp/groups')); + } + public function groups_manage_test_data() { return array( @@ -30,14 +54,10 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test */ public function test_groups_manage($input, $expected) { - $this->login(); - $this->admin_login(); - $this->add_lang(array('ucp', 'acp/groups')); + $this->group_manage_login(); // Manage Administrators group - $crawler = $this->request('GET', $this->get_url() . '&g=5&sid=' . $this->sid); - $this->assert_response_success(); - $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); + $form = $this->get_group_manage_form(); $form['group_colour']->setValue($input); $crawler = $this->client->submit($form); $this->assertContains($this->lang($expected), $crawler->text()); -- cgit v1.2.1