mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 20:38:52 +00:00
[ticket/12153] Adjust pagination tests.
PHPBB3-12153
This commit is contained in:
parent
1251b68668
commit
5f9d54646f
3 changed files with 17 additions and 15 deletions
|
@ -38,6 +38,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
|
||||||
10,
|
10,
|
||||||
10,
|
10,
|
||||||
'pagination
|
'pagination
|
||||||
|
:per_page:10
|
||||||
|
:current_page:2
|
||||||
|
:base_url:page.php
|
||||||
:previous::page.php
|
:previous::page.php
|
||||||
:else:1:page.php
|
:else:1:page.php
|
||||||
:current:2:page.php?start=10
|
:current:2:page.php?start=10
|
||||||
|
@ -57,6 +60,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
|
||||||
10,
|
10,
|
||||||
20,
|
20,
|
||||||
'pagination
|
'pagination
|
||||||
|
:per_page:10
|
||||||
|
:current_page:3
|
||||||
|
:base_url:page.php
|
||||||
:previous::page.php?start=10
|
:previous::page.php?start=10
|
||||||
:else:1:page.php
|
:else:1:page.php
|
||||||
:else:2:page.php?start=10
|
:else:2:page.php?start=10
|
||||||
|
@ -77,6 +83,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
|
||||||
10,
|
10,
|
||||||
10,
|
10,
|
||||||
'pagination
|
'pagination
|
||||||
|
:per_page:10
|
||||||
|
:current_page:2
|
||||||
|
:base_url:test/page/%d
|
||||||
:previous::test
|
:previous::test
|
||||||
:else:1:test
|
:else:1:test
|
||||||
:current:2:test/page/2
|
:current:2:test/page/2
|
||||||
|
@ -96,6 +105,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
|
||||||
10,
|
10,
|
||||||
20,
|
20,
|
||||||
'pagination
|
'pagination
|
||||||
|
:per_page:10
|
||||||
|
:current_page:3
|
||||||
|
:base_url:test/page/%d
|
||||||
:previous::test/page/2
|
:previous::test/page/2
|
||||||
:else:1:test
|
:else:1:test
|
||||||
:else:2:test/page/2
|
:else:2:test/page/2
|
||||||
|
@ -127,15 +139,10 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
'page.php',
|
|
||||||
10,
|
10,
|
||||||
10,
|
10,
|
||||||
0,
|
0,
|
||||||
'PAGE_OF-1-1',
|
'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
|
* @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->assertEquals($expect_return, $this->pagination->on_page($num_items, $per_page, $start_item));
|
||||||
|
|
||||||
$this->template->set_filenames(array('test' => 'on_page.html'));
|
|
||||||
|
|
||||||
$this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validate_start_data()
|
public function validate_start_data()
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
on_page
|
|
||||||
per_page:{PER_PAGE}
|
|
||||||
on_page:{ON_PAGE}
|
|
||||||
base_url:{BASE_URL}
|
|
|
@ -1,4 +1,7 @@
|
||||||
pagination
|
pagination
|
||||||
|
:per_page:{PER_PAGE}
|
||||||
|
:current_page:{CURRENT_PAGE}
|
||||||
|
:base_url:{BASE_URL}
|
||||||
<!-- BEGIN pagination -->
|
<!-- BEGIN pagination -->
|
||||||
<!-- IF pagination.S_IS_PREV -->:previous:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
|
<!-- IF pagination.S_IS_PREV -->:previous:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
|
||||||
<!-- ELSEIF pagination.S_IS_CURRENT -->:current:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
|
<!-- ELSEIF pagination.S_IS_CURRENT -->:current:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
|
||||||
|
|
Loading…
Add table
Reference in a new issue