You are here

public function PagerPluginBaseTest::testHasMoreRecords in Drupal 9

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

Tests the hasMoreRecords() method.

@dataProvider providerTestHasMoreRecords

See also

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

File

core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php, line 174
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 testHasMoreRecords($items_per_page, $total_items, $current_page, $has_more_records) {
  $this->pager
    ->setItemsPerPage($items_per_page);
  $this->pager->total_items = $total_items;
  $this->pager
    ->setCurrentPage($current_page);
  $this
    ->assertEquals($has_more_records, $this->pager
    ->hasMoreRecords());
}