mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 02:36:38 +02:00
[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
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user