public function testSimpleCounter($i) { $counter_handler =
new Counter([], 'counter',
$this->definition
);
$options =
[];
$counter_handler->
init($this->view,
$this->display,
$options);
$this->view->row_index =
$i;
$expected =
$i + 1;
$counter =
$counter_handler->
getValue($this->testData
[$i]);
$this->
assertEquals($expected,
$counter, 'The expected number matches with the counter number'
);
$counter =
$this->
renderCounter($counter_handler,
$this->testData
[$i]);
$this->
assertEquals($expected,
$counter, 'The expected number matches with the rendered number'
);
} /**
* Tests a counter with a random start.
*
* @param int $i
* The row index to test.
*
* @dataProvider providerRowIndexes
*/