You are here

public function GrantsTestMocked::testThatGrantsGetAllAddsExtraParams in Auth0 Single Sign On 8.2

Test that getAll sends additional parameters with the request.

Return value

void

Throws

\Exception Unsuccessful HTTP call.

File

vendor/auth0/auth0-php/tests/API/Management/GrantsMockedTest.php, line 111

Class

GrantsTestMocked
Class GrantsTestMocked.

Namespace

Auth0\Tests\API\Management

Code

public function testThatGrantsGetAllAddsExtraParams() {
  $api = new MockManagementApi([
    new Response(200),
  ]);
  $add_params = [
    'param1' => 'value1',
    'param2' => 'value2',
  ];
  $api
    ->call()
    ->grants()
    ->getAll(null, null, $add_params);
  $this
    ->assertEquals('GET', $api
    ->getHistoryMethod());
  $this
    ->assertStringStartsWith('https://api.test.local/api/v2/grants', $api
    ->getHistoryUrl());
  $this
    ->assertContains('param1=value1', $api
    ->getHistoryQuery());
  $this
    ->assertContains('param2=value2', $api
    ->getHistoryQuery());
}