mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-13 20:28:44 +01:00
[ticket/11538] Add tests for acp group manage page
This will currently test if the colour check properly works. PHPBB3-11538
This commit is contained in:
parent
deefe5c0e4
commit
cbe4a3c3b6
45
tests/functional/acp_groups_test.php
Normal file
45
tests/functional/acp_groups_test.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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_acp_groups_test extends phpbb_functional_test_case
|
||||
{
|
||||
public function groups_manage_test_data()
|
||||
{
|
||||
return array(
|
||||
array('#AA0000', 'WRONG_DATA_COLOUR'),
|
||||
array('AA0000', 'GROUP_UPDATED'),
|
||||
array('AA0000v', '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'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider groups_manage_test_data
|
||||
*/
|
||||
public function test_groups_manage($input, $expected)
|
||||
{
|
||||
$this->login();
|
||||
$this->admin_login();
|
||||
$this->add_lang(array('ucp', 'acp/groups'));
|
||||
|
||||
$crawler = $this->request('GET', 'adm/index.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($input);
|
||||
$crawler = $this->client->submit($form);
|
||||
$this->assertContains($this->lang($expected), $crawler->text());
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user