[ticket/12158] Add test data for 0 items to validate_start() test.

PHPBB3-12158
This commit is contained in:
Cesar G 2014-02-03 12:29:40 -08:00
parent 151c05e92e
commit 5e1db72532

View file

@ -155,24 +155,39 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
public function validate_start_data() public function validate_start_data()
{ {
return array( return array(
array(
0,
0,
0,
),
array( array(
-1, -1,
20,
0,
),
array(
20,
-30,
0, 0,
), ),
array( array(
0, 0,
20,
0, 0,
), ),
array( array(
10, 10,
20,
10, 10,
), ),
array( array(
20,
20, 20,
10, 10,
), ),
array( array(
30, 30,
20,
10, 10,
), ),
); );
@ -181,9 +196,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
/** /**
* @dataProvider validate_start_data * @dataProvider validate_start_data
*/ */
public function test_validate_start($start, $expect) public function test_validate_start($start, $num_items, $expect)
{ {
$this->assertEquals($expect, $this->pagination->validate_start($start, 10, 20)); $this->assertEquals($expect, $this->pagination->validate_start($start, 10, $num_items));
} }
public function reverse_start_data() public function reverse_start_data()