1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-26 04:52:36 +01:00
php-phpbb/tests/functional/acp_groups_test.php

125 lines
2.5 KiB
PHP
Raw Normal View History

<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/common_groups_test_case.php';
/**
* @group functional
*/
class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_test_case
{
protected $form_data;
protected function get_url()
{
return 'adm/index.php?i=groups&mode=manage&action=edit';
}
public function acp_group_test_data()
{
return array(
'both_yes' => array(
5,
true,
true,
),
'legend_no_teampage' => array(
5,
true,
false,
),
'no_legend_teampage' => array(
5,
false,
true,
),
'both_no' => array(
5,
false,
false,
),
'no_change' => array(
5,
NULL,
NULL,
),
'back_to_default' => array(
5,
true,
true,
),
// Remove and add moderators back in order to reset
// group order to default one
'mods_both_no' => array(
4,
false,
false,
),
'mods_back_to_default' => array(
4,
true,
true,
),
);
}
/**
* @dataProvider acp_group_test_data
*/
public function test_acp_groups_teampage($group_id, $tick_legend, $tick_teampage)
{
$this->group_manage_login();
// Manage Administrators group
$form = $this->get_group_manage_form($group_id);
$this->form_data[0] = $form->getValues();
if (isset($tick_legend) && isset($tick_teampage))
{
if ($tick_legend)
{
$form['group_legend']->tick();
}
else
{
$form['group_legend']->untick();
}
if ($tick_teampage)
{
$form['group_teampage']->tick();
}
else
{
$form['group_teampage']->untick();
}
}
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into ticket/11568-develop * 'develop' of https://github.com/phpbb/phpbb3: (29 commits) [ticket/11588] Also use version.phpbb.com in install_update.php. [ticket/11587] Add functional tests for group teampage settings [ticket/11538] Add admin as admins leader and moderator in memberlist_test [ticket/11587] Pass legend and teampage settings to group_create() [ticket/11586] Move $filedata['thumbnail'] to where it might be returned. [ticket/11586] Combine $filedata['post_attach'] assign into a single statement. [ticket/11586] Use a variable for $cat_id == ATTACHMENT_CATEGORY_IMAGE. [ticket/11586] Combine administrator/moderator checks together. [ticket/11583] Use a new lang key instead of giving the old one a new meaning. [ticket/11122] Add dhruv to active authors [ticket/11122] Remove Oleg and igorw from active authors [ticket/10840] Add check_form_key to acp_groups.php [ticket/11583] Allow FULLTEXT indexes on InnoDB when on MySQL 5.6.4 or higher. [ticket/11409] Add success message after updating group position settings [ticket/11549] Add functional test for ACP Extension Module with Template [ticket/11570] Fix link and make the notice more conspiciuous [ticket/11549] Do not set extension dir path for style in adm/index.php [ticket/11570] Add link back to update process [ticket/11569] Add type parameter and fix language variable [ticket/11569] Add parameter to URL and remove comment ... Conflicts: tests/functional/common_groups_test.php
2013-06-07 00:15:28 +02:00
$crawler = self::submit($form);
$this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
$form = $this->get_group_manage_form($group_id);
if (!isset($tick_legend) && !isset($tick_teampage))
{
$this->form_data[1] = $form->getValues();
unset($this->form_data[0]['creation_time'], $this->form_data[0]['form_token'], $this->form_data[1]['creation_time'], $this->form_data[1]['form_token']);
$this->assertEquals($this->form_data[0], $this->form_data[1]);
}
else
{
$this->form_data = $form->getValues();
$this->assertEquals($tick_legend, $this->form_data['group_legend']);
$this->assertEquals($tick_teampage, $this->form_data['group_teampage']);
}
}
}