function ResultTest::testResultArea

Same name and namespace in other branches
  1. 8.9.x core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php \Drupal\Tests\views\Unit\Plugin\area\ResultTest::testResultArea()
  2. 10 core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php \Drupal\Tests\views\Unit\Plugin\area\ResultTest::testResultArea()
  3. 11.x core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php \Drupal\Tests\views\Unit\Plugin\area\ResultTest::testResultArea()

Tests the rendered output of the Result area handler.

@dataProvider providerTestResultArea

Parameters

string $content: The content to use when rendering the handler.

string $expected: The expected content string.

int $items_per_page: The items per page of the configuration.

File

core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php, line 82

Class

ResultTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21area%21Result.php/class/Result/9" title="Views area handler to display some configurable result summary." class="local">\Drupal\views\Plugin\views\area\Result</a> @group views

Namespace

Drupal\Tests\views\Unit\Plugin\area

Code

public function testResultArea($content, $expected, $items_per_page = 0) {
    $this->setupViewPager($items_per_page);
    $this->resultHandler->options['content'] = $content;
    $this->assertEquals([
        '#markup' => $expected,
    ], $this->resultHandler
        ->render());
}

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