mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/13538] Add test for pagination in nested loop
PHPBB3-13538
This commit is contained in:
parent
40ab75478e
commit
7014d824f0
2 changed files with 28 additions and 0 deletions
|
@ -172,6 +172,17 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
|
||||||
$this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
|
$this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider generate_template_pagination_data
|
||||||
|
*/
|
||||||
|
public function test_generate_template_pagination_sub($base_url, $start_name, $num_items, $per_page, $start_item, $expect)
|
||||||
|
{
|
||||||
|
$this->pagination->generate_template_pagination($base_url, 'sub.pagination', $start_name, $num_items, $per_page, $start_item);
|
||||||
|
$this->template->set_filenames(array('test' => 'pagination_sub.html'));
|
||||||
|
|
||||||
|
$this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
|
||||||
|
}
|
||||||
|
|
||||||
public function on_page_data()
|
public function on_page_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
|
17
tests/pagination/templates/pagination_sub.html
Normal file
17
tests/pagination/templates/pagination_sub.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
pagination
|
||||||
|
<!-- BEGIN sub -->
|
||||||
|
:per_page:{sub.PER_PAGE}
|
||||||
|
:current_page:{sub.CURRENT_PAGE}
|
||||||
|
:base_url:{sub.BASE_URL}
|
||||||
|
<!-- BEGIN pagination -->
|
||||||
|
<!-- IF sub.pagination.S_IS_PREV -->:previous:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
|
||||||
|
<!-- ELSEIF sub.pagination.S_IS_CURRENT -->:current:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
|
||||||
|
<!-- ELSEIF sub.pagination.S_IS_ELLIPSIS -->:ellipsis:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
|
||||||
|
<!-- ELSEIF sub.pagination.S_IS_NEXT -->:next:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
|
||||||
|
<!-- ELSE -->:else:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
|
||||||
|
<!-- ENDIF -->
|
||||||
|
<!-- END pagination -->
|
||||||
|
<!-- IF U_PREVIOUS_PAGE -->:u_prev:{sub.U_PREVIOUS_PAGE}<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- IF U_NEXT_PAGE -->:u_next:{sub.U_NEXT_PAGE}<!-- ENDIF -->
|
||||||
|
<!-- END sub -->
|
Loading…
Add table
Reference in a new issue