public function ResultTest::testQuery in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php \Drupal\Tests\views\Unit\Plugin\area\ResultTest::testQuery()
- 9 core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php \Drupal\Tests\views\Unit\Plugin\area\ResultTest::testQuery()
Tests the query method.
File
- core/
modules/ views/ tests/ src/ Unit/ Plugin/ area/ ResultTest.php, line 54
Class
- ResultTest
- @coversDefaultClass \Drupal\views\Plugin\views\area\Result @group views
Namespace
Drupal\Tests\views\Unit\Plugin\areaCode
public function testQuery() {
$this
->assertNull($this->view->get_total_rows);
// @total should set get_total_rows.
$this->resultHandler->options['content'] = '@total';
$this->resultHandler
->query();
$this
->assertTrue($this->view->get_total_rows);
// A different token should not.
$this->view->get_total_rows = NULL;
$this->resultHandler->options['content'] = '@current_page';
$this->resultHandler
->query();
$this
->assertNull($this->view->get_total_rows);
}