diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-04-11 15:18:47 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-04-11 15:20:14 +0200 |
commit | 59ad90b25c50f0a4062ae5e190b27811c4c0279b (patch) | |
tree | cf38bb4da32907ba0d050ad06c2b00c4052eed15 /tests/functional/memberlist_test.php | |
parent | 60713c8a203b4d92db016f38cf8d78165d72b30a (diff) | |
download | forums-59ad90b25c50f0a4062ae5e190b27811c4c0279b.tar forums-59ad90b25c50f0a4062ae5e190b27811c4c0279b.tar.gz forums-59ad90b25c50f0a4062ae5e190b27811c4c0279b.tar.bz2 forums-59ad90b25c50f0a4062ae5e190b27811c4c0279b.tar.xz forums-59ad90b25c50f0a4062ae5e190b27811c4c0279b.zip |
[ticket/11492] Add tests for removing/adding users
PHPBB3-11492
Diffstat (limited to 'tests/functional/memberlist_test.php')
-rw-r--r-- | tests/functional/memberlist_test.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/functional/memberlist_test.php b/tests/functional/memberlist_test.php index 5c5d96d777..f27092aa36 100644 --- a/tests/functional/memberlist_test.php +++ b/tests/functional/memberlist_test.php @@ -44,9 +44,32 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case public function test_leaders() { $this->login(); + $this->create_user('memberlist-test-user'); + $this->create_user('memberlist-test-moderator'); + + // Admin should be listed, user not + $crawler = $this->request('GET', 'memberlist.php?mode=leaders&sid=' . $this->sid); + $this->assert_response_success(); + $this->assertContains('admin', $crawler->filter('tr')->text()); + $this->assertNotContains('memberlist-test-user', $crawler->filter('tr')->text()); + $this->assertNotContains('memberlist-test-moderator', $crawler->filter('tr')->text()); + + // Remove admin from admins, still a moderator $this->remove_user_group('ADMINISTRATORS', array('admin')); + $crawler = $this->request('GET', 'memberlist.php?mode=leaders&sid=' . $this->sid); + $this->assert_response_success(); + $this->assertContains('admin', $crawler->filter('tr')->text()); + + // Remove admin from moderators + $this->remove_user_group('GLOBAL_MODERATORS', array('admin')); + $crawler = $this->request('GET', 'memberlist.php?mode=leaders&sid=' . $this->sid); + $this->assert_response_success(); + $this->assertNotContains('admin', $crawler->filter('tr')->text()); + // Add mod to moderators + $this->add_user_group('GLOBAL_MODERATORS', array('memberlist-test-moderator')); $crawler = $this->request('GET', 'memberlist.php?mode=leaders&sid=' . $this->sid); $this->assert_response_success(); + $this->assertContains('memberlist-test-moderator', $crawler->filter('tr')->text()); } } |