function PagerTest::testViewTotalRowsWithoutPager

Same name in other branches
  1. 9 core/modules/views/tests/src/Functional/Plugin/PagerTest.php \Drupal\Tests\views\Functional\Plugin\PagerTest::testViewTotalRowsWithoutPager()
  2. 8.9.x core/modules/views/tests/src/Functional/Plugin/PagerTest.php \Drupal\Tests\views\Functional\Plugin\PagerTest::testViewTotalRowsWithoutPager()
  3. 10 core/modules/views/tests/src/Functional/Plugin/PagerTest.php \Drupal\Tests\views\Functional\Plugin\PagerTest::testViewTotalRowsWithoutPager()

File

core/modules/views/tests/src/Functional/Plugin/PagerTest.php, line 254

Class

PagerTest
Tests the pluggable pager system.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

public function testViewTotalRowsWithoutPager() : void {
    $this->drupalCreateContentType([
        'type' => 'page',
    ]);
    for ($i = 0; $i < 23; $i++) {
        $this->drupalCreateNode();
    }
    $view = Views::getView('test_pager_none');
    $view->get_total_rows = TRUE;
    $this->executeView($view);
    $this->assertEquals(23, $view->total_rows, "'total_rows' is calculated when pager type is 'none' and 'get_total_rows' is TRUE.");
}

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