You are here

public function PagerTest::testViewTotalRowsWithoutPager in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Plugin/PagerTest.php \Drupal\views\Tests\Plugin\PagerTest::testViewTotalRowsWithoutPager()

File

core/modules/views/src/Tests/Plugin/PagerTest.php, line 161
Contains \Drupal\views\Tests\Plugin\PagerTest.

Class

PagerTest
Tests the pluggable pager system.

Namespace

Drupal\views\Tests\Plugin

Code

public function testViewTotalRowsWithoutPager() {
  $this
    ->drupalCreateContentType(array(
    '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
    ->assertEqual($view->total_rows, 23, "'total_rows' is calculated when pager type is 'none' and 'get_total_rows' is TRUE.");
}