aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-05-14 13:43:53 +0200
committerMarc Alexander <admin@m-a-styles.de>2013-05-14 13:43:53 +0200
commitb7b0b0ccc3fbf92324948e8c5e616a3e06343600 (patch)
tree94b4d08f0290018d849a76fde2d66f10c12d3317 /tests/functional
parent45e014d35d755363224a8a84dd9bb51299a6f107 (diff)
downloadforums-b7b0b0ccc3fbf92324948e8c5e616a3e06343600.tar
forums-b7b0b0ccc3fbf92324948e8c5e616a3e06343600.tar.gz
forums-b7b0b0ccc3fbf92324948e8c5e616a3e06343600.tar.bz2
forums-b7b0b0ccc3fbf92324948e8c5e616a3e06343600.tar.xz
forums-b7b0b0ccc3fbf92324948e8c5e616a3e06343600.zip
[ticket/11538] Make sure group color can't exceed maximum of 6 characters
In order to prevent future issues with this, a basic set of functional tests for the UCP groups manage page have been added. PHPBB3-11538
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/ucp_groups_test.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/functional/ucp_groups_test.php b/tests/functional/ucp_groups_test.php
new file mode 100644
index 0000000000..010727cb55
--- /dev/null
+++ b/tests/functional/ucp_groups_test.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_ucp_groups_test extends phpbb_functional_test_case
+{
+ public function test_groups_manage()
+ {
+ $values = array();
+ $this->login();
+ $this->add_lang(array('ucp', 'acp/groups'));
+
+ $crawler = $this->request('GET', 'ucp.php?i=groups&mode=manage&action=edit&g=5&sid=' . $this->sid);
+ $this->assert_response_success();
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['group_colour']->setValue('#AA0000');
+ $crawler = $this->client->submit($form);
+ $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
+
+ $crawler = $this->request('GET', 'ucp.php?i=groups&mode=manage&action=edit&g=5&sid=' . $this->sid);
+ $this->assert_response_success();
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $values = $form->getValues();
+ $this->assertContains('AA0000', $values['group_colour']);
+ $form['group_colour']->setValue('AA0000');
+ $crawler = $this->client->submit($form);
+ $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
+
+ $crawler = $this->request('GET', 'ucp.php?i=groups&mode=manage&action=edit&g=5&sid=' . $this->sid);
+ $this->assert_response_success();
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $values = $form->getValues();
+ $this->assertContains('AA0000', $values['group_colour']);
+ $form['group_colour']->setValue('AA0000v');
+ $crawler = $this->client->submit($form);
+ $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
+
+ $crawler = $this->request('GET', 'ucp.php?i=groups&mode=manage&action=edit&g=5&sid=' . $this->sid);
+ $this->assert_response_success();
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $values = $form->getValues();
+ $this->assertContains('AA0000', $values['group_colour']);
+ $form['group_colour']->setValue('vAA0000');
+ $crawler = $this->client->submit($form);
+ $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
+
+ $crawler = $this->request('GET', 'ucp.php?i=groups&mode=manage&action=edit&g=5&sid=' . $this->sid);
+ $this->assert_response_success();
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $values = $form->getValues();
+ $this->assertContains('vAA000', $values['group_colour']);
+ }
+}