function CounterTest::renderCounter

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php \Drupal\Tests\views\Unit\Plugin\field\CounterTest::renderCounter()
  2. 8.9.x core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php \Drupal\Tests\views\Unit\Plugin\field\CounterTest::renderCounter()
  3. 11.x core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php \Drupal\Tests\views\Unit\Plugin\field\CounterTest::renderCounter()

Renders the counter field handler.

Parameters

\Drupal\views\Plugin\views\field\Counter $handler: The counter handler.

\Drupal\views\ResultRow $row: A result row.

Return value

string The counter rendered markup.

4 calls to CounterTest::renderCounter()
CounterTest::testCounterRandomPagerOffset in core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
Tests a counter field with a random pager offset.
CounterTest::testCounterRandomStart in core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
Tests a counter with a random start.
CounterTest::testCounterSecondPage in core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
Tests a counter field on the second page.
CounterTest::testSimpleCounter in core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
Tests a simple counter field.

File

core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php, line 232

Class

CounterTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21field%21Counter.php/class/Counter/10" title="Field handler to show a counter of the current row." class="local">\Drupal\views\Plugin\views\field\Counter</a> @group views

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

protected function renderCounter(Counter $handler, ResultRow $row) {
    $markup = $handler->render($row);
    $handler->postRender($row, $markup);
    return $handler->last_render;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.