mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Merge remote-tracking branch 'marc1706/ticket/11538' into develop
* marc1706/ticket/11538: [ticket/11538] Add admin as admins leader and moderator in memberlist_test
This commit is contained in:
commit
7b7747cab6
3 changed files with 14 additions and 8 deletions
|
@ -30,12 +30,6 @@ abstract class phpbb_functional_common_groups_test extends phpbb_functional_test
|
||||||
*/
|
*/
|
||||||
public function test_groups_manage($input, $expected)
|
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->login();
|
||||||
$this->admin_login();
|
$this->admin_login();
|
||||||
$this->add_lang(array('ucp', 'acp/groups'));
|
$this->add_lang(array('ucp', 'acp/groups'));
|
||||||
|
|
|
@ -95,5 +95,17 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
||||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
$this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text());
|
$this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text());
|
||||||
$this->assertContains('memberlist-test-moderator', $crawler->eq(1)->text());
|
$this->assertContains('memberlist-test-moderator', $crawler->eq(1)->text());
|
||||||
|
|
||||||
|
// Add admin to moderators, should be visible as moderator
|
||||||
|
$this->add_user_group('GLOBAL_MODERATORS', array('admin'), true);
|
||||||
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
|
$this->assertNotContains('admin', $crawler->eq(0)->text());
|
||||||
|
$this->assertContains('admin', $crawler->eq(1)->text());
|
||||||
|
|
||||||
|
// Add admin to admins as leader, should be visible as admin, not moderator
|
||||||
|
$this->add_user_group('ADMINISTRATORS', array('admin'), true, true);
|
||||||
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
|
$this->assertContains('admin', $crawler->eq(0)->text());
|
||||||
|
$this->assertNotContains('admin', $crawler->eq(1)->text());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,7 +361,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
return group_user_del($group_id, false, $usernames, $group_name);
|
return group_user_del($group_id, false, $usernames, $group_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function add_user_group($group_name, $usernames)
|
protected function add_user_group($group_name, $usernames, $default = false, $leader = false)
|
||||||
{
|
{
|
||||||
global $db, $cache, $auth, $config, $phpbb_dispatcher, $phpbb_log, $phpbb_container, $phpbb_root_path, $phpEx;
|
global $db, $cache, $auth, $config, $phpbb_dispatcher, $phpbb_log, $phpbb_container, $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
$group_id = (int) $db->sql_fetchfield('group_id');
|
$group_id = (int) $db->sql_fetchfield('group_id');
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
return group_user_add($group_id, false, $usernames, $group_name);
|
return group_user_add($group_id, false, $usernames, $group_name, $default, $leader);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function login($username = 'admin')
|
protected function login($username = 'admin')
|
||||||
|
|
Loading…
Add table
Reference in a new issue