You are here

public function ConnectionsTestMocked::testThatConnectionsGetExcludesFields in Auth0 Single Sign On 8.2

Test a get call with excluded fields.

Return value

void

Throws

\Exception Unsuccessful HTTP call.

File

vendor/auth0/auth0-php/tests/API/Management/ConnectionsMockedTest.php, line 245

Class

ConnectionsTestMocked
Class ConnectionsTestMocked.

Namespace

Auth0\Tests\API\Management

Code

public function testThatConnectionsGetExcludesFields() {
  $api = new MockManagementApi([
    new Response(200, self::$headers),
  ]);
  $id = 'con_testConnection10';
  $fields = [
    'name',
    'strategy',
  ];
  $include_fields = false;
  $api
    ->call()
    ->connections()
    ->get($id, $fields, $include_fields);
  $this
    ->assertEquals('GET', $api
    ->getHistoryMethod());
  $this
    ->assertStringStartsWith('https://api.test.local/api/v2/connections/' . $id, $api
    ->getHistoryUrl());
  $this
    ->assertContains('fields=' . implode(',', $fields), $api
    ->getHistoryQuery());
  $this
    ->assertContains('include_fields=false', $api
    ->getHistoryQuery());
}