You are here

public function PagerPluginBaseTest::providerTestHasMoreRecords in Zircon Profile 8

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

Provides test data for the hasMoreRecord method test.

See also

self::testHasMoreRecords

File

core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php, line 185
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 providerTestHasMoreRecords() {
  return array(
    // No items per page, so there can't be more available records.
    array(
      0,
      0,
      0,
      FALSE,
    ),
    array(
      0,
      10,
      0,
      FALSE,
    ),
    // The amount of total items equals the items per page, so there is no
    // next page available.
    array(
      5,
      5,
      0,
      FALSE,
    ),
    // There is one more item, and we are at the first page.
    array(
      5,
      6,
      0,
      TRUE,
    ),
    // Now we are on the second page, which has just a single one left.
    array(
      5,
      6,
      1,
      FALSE,
    ),
    // Increase the total items, so we have some available on the third page.
    array(
      5,
      12,
      1,
      TRUE,
    ),
  );
}