From 2ea6bfa6fb2ef27b695cceac865a49c7a5563324 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 6 Apr 2014 01:13:42 +0200 Subject: [PATCH 1/2] [ticket/229] Display all groups in who is online module B3P-229 --- modules/whois_online.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/whois_online.php b/modules/whois_online.php index 5e56c385..758e070a 100644 --- a/modules/whois_online.php +++ b/modules/whois_online.php @@ -95,7 +95,7 @@ class whois_online extends module_base { $sql = 'SELECT group_id, group_name, group_colour, group_type FROM ' . GROUPS_TABLE . ' - WHERE group_legend = 1 + WHERE group_legend > 0 ORDER BY group_name ASC'; } else @@ -108,7 +108,7 @@ class whois_online extends module_base AND ug.user_id = ' . $this->user->data['user_id'] . ' AND ug.user_pending = 0 ) - WHERE g.group_legend = 1 + WHERE g.group_legend > 0 AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $this->user->data['user_id'] . ') ORDER BY g.group_name ASC'; } From 85ea21854577ebd4870a633336c2afa336196dd3 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 6 Apr 2014 01:26:36 +0200 Subject: [PATCH 2/2] [ticket/229] Test if legend contains more than just Administrators B3P-229 --- tests/functional/portal_visit_registered_test.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/functional/portal_visit_registered_test.php b/tests/functional/portal_visit_registered_test.php index 44acfa0d..22df375c 100644 --- a/tests/functional/portal_visit_registered_test.php +++ b/tests/functional/portal_visit_registered_test.php @@ -97,4 +97,13 @@ class phpbb_functional_portal_visit_registered_test extends \board3\portal\tests $this->logout(); $crawler = self::request('GET', 'app.php/portal'); } + + public function test_whois_online_legend() + { + $crawler = self::request('GET', 'app.php/portal'); + + $legend = $crawler->filter('dd.portal-responsive-show p em')->text(); + $this->assertContains('Administrators', $legend); + $this->assertContains('Global moderators', $legend); + } }