mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 19:24:01 +02:00
[ticket/15886] Group helper functions
PHPBB3-15886
This commit is contained in:
43
tests/group/helper_get_rank_test.php
Normal file
43
tests/group/helper_get_rank_test.php
Normal file
@@ -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));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user