aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pagination/pagination_test.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-12-12 02:30:56 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-12-18 18:35:16 +0100
commit725c51246822320ad8a723ac73c7ea4dd61bed39 (patch)
tree2f60e098c60aeca9365355950e945fdefc9f76a6 /tests/pagination/pagination_test.php
parentfcfa1a35cc73471e4f8844920cdcf4d4990ce6b0 (diff)
downloadforums-725c51246822320ad8a723ac73c7ea4dd61bed39.tar
forums-725c51246822320ad8a723ac73c7ea4dd61bed39.tar.gz
forums-725c51246822320ad8a723ac73c7ea4dd61bed39.tar.bz2
forums-725c51246822320ad8a723ac73c7ea4dd61bed39.tar.xz
forums-725c51246822320ad8a723ac73c7ea4dd61bed39.zip
[ticket/11849] Replace pagination in viewforum.php with class
PHPBB3-11849
Diffstat (limited to 'tests/pagination/pagination_test.php')
-rw-r--r--tests/pagination/pagination_test.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php
index 69e003db6b..4e8083b47f 100644
--- a/tests/pagination/pagination_test.php
+++ b/tests/pagination/pagination_test.php
@@ -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));
+ }
}