You are here

public function IndexResourceTest::paginationDataProvider in JSON:API Search API 8

Pagination data provider.

Return value

\Generator The data.

File

tests/src/Functional/IndexResourceTest.php, line 166

Class

IndexResourceTest
Tests index resource..

Namespace

Drupal\Tests\jsonapi_search_api\Functional

Code

public function paginationDataProvider() : \Generator {
  (yield [
    [
      'page' => [
        'limit' => 2,
        'offset' => 0,
      ],
    ],
    2,
    [
      1,
      2,
    ],
    [
      'next',
      'last',
    ],
  ]);
  (yield [
    [
      'page' => [
        'limit' => 2,
        'offset' => 2,
      ],
    ],
    2,
    [
      3,
      4,
    ],
    [
      'next',
      'last',
      'prev',
      'first',
    ],
  ]);
}