You are here

public function PagerPluginBaseTest::testGetTotalItems in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest::testGetTotalItems()

Tests the getTotalItems() method.

See also

\Drupal\views\Plugin\views\pager\PagerPluginBase::getTotalItems()

File

core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php, line 118
Contains \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest.

Class

PagerPluginBaseTest
@coversDefaultClass \Drupal\views\Plugin\views\pager\PagerPluginBase @group views

Namespace

Drupal\Tests\views\Unit\Plugin\pager

Code

public function testGetTotalItems() {

  // Should return 0 by default.
  $this
    ->assertEquals(0, $this->pager
    ->getTotalItems());
  $this->pager->total_items = 10;
  $this
    ->assertEquals(10, $this->pager
    ->getTotalItems());
}