aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/memberlist_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/memberlist_test.php')
-rw-r--r--tests/functional/memberlist_test.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/functional/memberlist_test.php b/tests/functional/memberlist_test.php
new file mode 100644
index 0000000000..879bee2f0e
--- /dev/null
+++ b/tests/functional/memberlist_test.php
@@ -0,0 +1,43 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_memberlist_test extends phpbb_functional_test_case
+{
+ public function test_memberlist()
+ {
+ $this->create_user('memberlist-test-user');
+ // logs in as admin
+ $this->login();
+ $crawler = $this->request('GET', 'memberlist.php?sid=' . $this->sid);
+ $this->assert_response_success();
+ $this->assertContains('memberlist-test-user', $crawler->text());
+
+ // restrict by first character
+ $crawler = $this->request('GET', 'memberlist.php?first_char=m&sid=' . $this->sid);
+ $this->assert_response_success();
+ $this->assertContains('memberlist-test-user', $crawler->text());
+
+ // make sure results for wrong character are not returned
+ $crawler = $this->request('GET', 'memberlist.php?first_char=a&sid=' . $this->sid);
+ $this->assert_response_success();
+ $this->assertNotContains('memberlist-test-user', $crawler->text());
+ }
+
+ public function test_viewprofile()
+ {
+ $this->login();
+ // XXX hardcoded user id
+ $crawler = $this->request('GET', 'memberlist.php?mode=viewprofile&u=2&sid=' . $this->sid);
+ $this->assert_response_success();
+ $this->assertContains('admin', $crawler->filter('h2')->text());
+ }
+}