function AreaResultTest::testResult

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php \Drupal\Tests\views\Kernel\Handler\AreaResultTest::testResult()
  2. 8.9.x core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php \Drupal\Tests\views\Kernel\Handler\AreaResultTest::testResult()
  3. 10 core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php \Drupal\Tests\views\Kernel\Handler\AreaResultTest::testResult()

Tests the results area handler.

File

core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php, line 26

Class

AreaResultTest
Tests the result area handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testResult() : void {
    $view = Views::getView('test_area_result');
    $view->setDisplay('default');
    $this->executeView($view);
    $output = $view->render();
    $output = \Drupal::service('renderer')->renderRoot($output);
    $this->setRawContent($output);
    $this->assertText('start: 1 | end: 5 | total: 5 | label: test_area_result | per page: 0 | current page: 1 | current record count: 5 | page count: 1');
    // Make sure that potentially dangerous content was stripped.
    $this->assertNoRaw('<script />');
}

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