You are here

public function ClientGrantsTest::testGetWithPagination in Auth0 Single Sign On 8.2

Test that pagination parameters are passed to the endpoint.

Return value

void

Throws

\Exception Thrown by the Guzzle HTTP client when there is a problem with the API call.

File

vendor/auth0/auth0-php/tests/API/Management/ClientGrantsTest.php, line 126

Class

ClientGrantsTest
Class ClientGrantsTest. Tests the Auth0\SDK\API\Management\ClientGrants class.

Namespace

Auth0\Tests\API

Code

public function testGetWithPagination() {
  $expected_count = 2;
  $results_1 = self::$api
    ->getAll([], 0, $expected_count);
  usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);
  $this
    ->assertCount($expected_count, $results_1);
  $expected_page = 1;
  $results_2 = self::$api
    ->getAll([], $expected_page, 1);
  usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);
  $this
    ->assertCount(1, $results_2);
  $this
    ->assertEquals($results_1[$expected_page]['client_id'], $results_2[0]['client_id']);
  $this
    ->assertEquals($results_1[$expected_page]['audience'], $results_2[0]['audience']);
}