aboutsummaryrefslogtreecommitdiffstats
path: root/tests/group/helper_get_rank_test.php
diff options
context:
space:
mode:
authormrgoldy <gijsmartens1@gmail.com>2018-11-29 19:56:24 +0100
committermrgoldy <gijsmartens1@gmail.com>2018-11-29 19:56:24 +0100
commitb6f6930eb56b9fd64f200a7b0e6d8cd28f0e73f6 (patch)
tree2de0b207ec17d8947fd966c834d2f82750061205 /tests/group/helper_get_rank_test.php
parent04d825ec2dd24f2e486f11eae5fe2c1846bbcd7c (diff)
downloadforums-b6f6930eb56b9fd64f200a7b0e6d8cd28f0e73f6.tar
forums-b6f6930eb56b9fd64f200a7b0e6d8cd28f0e73f6.tar.gz
forums-b6f6930eb56b9fd64f200a7b0e6d8cd28f0e73f6.tar.bz2
forums-b6f6930eb56b9fd64f200a7b0e6d8cd28f0e73f6.tar.xz
forums-b6f6930eb56b9fd64f200a7b0e6d8cd28f0e73f6.zip
[ticket/15886] Group helper functions
PHPBB3-15886
Diffstat (limited to 'tests/group/helper_get_rank_test.php')
-rw-r--r--tests/group/helper_get_rank_test.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/group/helper_get_rank_test.php b/tests/group/helper_get_rank_test.php
new file mode 100644
index 0000000000..5efd8ad95e
--- /dev/null
+++ b/tests/group/helper_get_rank_test.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+require_once dirname(__FILE__) . '/helper_test_case.php';
+
+class phpbb_group_helper_get_rank_test extends phpbb_group_helper_test_case
+{
+ public function get_rank_data()
+ {
+ global $phpbb_root_path;
+
+ return array(
+ array(
+ array('group_id' => 0, 'group_rank' => 1),
+ array(
+ 'title' => 'Site admin',
+ 'img' => '<img src="' . $phpbb_root_path . 'images/ranks/siteadmin.png' . '" alt="Site admin" title="Site admin" />',
+ 'img_src' => $phpbb_root_path . 'images/ranks/siteadmin.png',
+ )
+ ),
+ array(array('group_id' => 1, 'group_rank' => 0), array('title' => null, 'img' => null, 'img_src' => null)),
+ array(array('group_id' => 2, 'group_rank' => 2), array('title' => 'Test member', 'img' => '', 'img_src' => '')),
+ );
+ }
+
+ /**
+ * @dataProvider get_rank_data
+ */
+ public function test_get_rank($group_data, $expected)
+ {
+ $this->assertEquals($expected, $this->group_helper->get_rank($group_data));
+ }
+}