function PagerPluginBaseTest::testHasMoreRecords

Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest::testHasMoreRecords()
  2. 8.9.x core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest::testHasMoreRecords()
  3. 10 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 176

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) : void {
    $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());
}

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