aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2014-02-03 22:51:24 -0800
committerCesar G <prototech91@gmail.com>2014-02-03 23:00:39 -0800
commit5f9d54646f03a7b646181f6e08a6949d29145eab (patch)
treee41608112250f01df1316a94033c8b5a5fe6e245
parent1251b68668c656bc077fff3dd22661447e2905e3 (diff)
downloadforums-5f9d54646f03a7b646181f6e08a6949d29145eab.tar
forums-5f9d54646f03a7b646181f6e08a6949d29145eab.tar.gz
forums-5f9d54646f03a7b646181f6e08a6949d29145eab.tar.bz2
forums-5f9d54646f03a7b646181f6e08a6949d29145eab.tar.xz
forums-5f9d54646f03a7b646181f6e08a6949d29145eab.zip
[ticket/12153] Adjust pagination tests.
PHPBB3-12153
-rw-r--r--tests/pagination/pagination_test.php25
-rw-r--r--tests/pagination/templates/on_page.html4
-rw-r--r--tests/pagination/templates/pagination.html3
3 files changed, 17 insertions, 15 deletions
diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php
index 4e8083b47f..4c658cbd56 100644
--- a/tests/pagination/pagination_test.php
+++ b/tests/pagination/pagination_test.php
@@ -38,6 +38,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
10,
10,
'pagination
+ :per_page:10
+ :current_page:2
+ :base_url:page.php
:previous::page.php
:else:1:page.php
:current:2:page.php?start=10
@@ -57,6 +60,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
10,
20,
'pagination
+ :per_page:10
+ :current_page:3
+ :base_url:page.php
:previous::page.php?start=10
:else:1:page.php
:else:2:page.php?start=10
@@ -77,6 +83,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
10,
10,
'pagination
+ :per_page:10
+ :current_page:2
+ :base_url:test/page/%d
:previous::test
:else:1:test
:current:2:test/page/2
@@ -96,6 +105,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
10,
20,
'pagination
+ :per_page:10
+ :current_page:3
+ :base_url:test/page/%d
:previous::test/page/2
:else:1:test
:else:2:test/page/2
@@ -127,15 +139,10 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
{
return array(
array(
- 'page.php',
10,
10,
0,
'PAGE_OF-1-1',
- 'on_page
- per_page:10
- on_page:1
- base_url:page.php',
),
);
}
@@ -143,13 +150,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
/**
* @dataProvider on_page_data
*/
- public function test_on_page($base_url, $num_items, $per_page, $start_item, $expect_return, $expect)
+ public function test_on_page($num_items, $per_page, $start_item, $expect_return)
{
- $this->assertEquals($expect_return, $this->pagination->on_page($base_url, $num_items, $per_page, $start_item));
-
- $this->template->set_filenames(array('test' => 'on_page.html'));
-
- $this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
+ $this->assertEquals($expect_return, $this->pagination->on_page($num_items, $per_page, $start_item));
}
public function validate_start_data()
diff --git a/tests/pagination/templates/on_page.html b/tests/pagination/templates/on_page.html
deleted file mode 100644
index 364bcf9f5e..0000000000
--- a/tests/pagination/templates/on_page.html
+++ /dev/null
@@ -1,4 +0,0 @@
-on_page
-per_page:{PER_PAGE}
-on_page:{ON_PAGE}
-base_url:{BASE_URL}
diff --git a/tests/pagination/templates/pagination.html b/tests/pagination/templates/pagination.html
index 7f2a329804..db63258585 100644
--- a/tests/pagination/templates/pagination.html
+++ b/tests/pagination/templates/pagination.html
@@ -1,4 +1,7 @@
pagination
+:per_page:{PER_PAGE}
+:current_page:{CURRENT_PAGE}
+:base_url:{BASE_URL}
<!-- BEGIN pagination -->
<!-- IF pagination.S_IS_PREV -->:previous:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
<!-- ELSEIF pagination.S_IS_CURRENT -->:current:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}