public function RolesTestMocked::testThatGetRolePermissionsRequestIsFormattedProperly in Auth0 Single Sign On 8.2
Test a get role permissions call.
Return value
void
Throws
\Exception Should not be thrown in this test.
File
- vendor/
auth0/ auth0-php/ tests/ API/ Management/ RolesMockedTest.php, line 287
Class
- RolesTestMocked
- Class RolesTestMocked.
Namespace
Auth0\Tests\API\ManagementCode
public function testThatGetRolePermissionsRequestIsFormattedProperly() {
$api = new MockManagementApi([
new Response(200, self::$headers),
]);
$api
->call()
->roles()
->getPermissions('__test_role_id__', [
'page' => -3,
'per_page' => -6,
]);
$this
->assertEquals('GET', $api
->getHistoryMethod());
$this
->assertStringStartsWith('https://api.test.local/api/v2/roles/__test_role_id__/permissions', $api
->getHistoryUrl());
$headers = $api
->getHistoryHeaders();
$this
->assertEquals('Bearer __api_token__', $headers['Authorization'][0]);
$this
->assertEquals(self::$expectedTelemetry, $headers['Auth0-Client'][0]);
$query = $api
->getHistoryQuery();
$this
->assertContains('page=3', $query);
$this
->assertContains('per_page=6', $query);
}