1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

[ticket/11849] Replace pagination in viewforum.php with class

PHPBB3-11849
This commit is contained in:
Joas Schilling
2013-12-12 02:30:56 +01:00
parent fcfa1a35cc
commit 725c512468
3 changed files with 105 additions and 21 deletions

View File

@@ -185,4 +185,56 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
{
$this->assertEquals($expect, $this->pagination->validate_start($start, 10, 20));
}
public function reverse_start_data()
{
return array(
array(
10,
5,
15,
0,
),
array(
10,
10,
25,
5,
),
);
}
/**
* @dataProvider reverse_start_data
*/
public function test_reverse_start($start, $limit, $num_items, $expect)
{
$this->assertEquals($expect, $this->pagination->reverse_start($start, $limit, $num_items));
}
public function reverse_limit_data()
{
return array(
array(
10,
10,
15,
5,
),
array(
20,
10,
15,
1,
),
);
}
/**
* @dataProvider reverse_limit_data
*/
public function test_reverse_limit($start, $per_page, $num_items, $expect)
{
$this->assertEquals($expect, $this->pagination->reverse_limit($start, $per_page, $num_items));
}
}