You are here

public function ResourceServersTest::testUpdate in Auth0 Single Sign On 8.2

Test updating the created Resource Server.

Return value

void

Throws

CoreException Thrown if the identifier parameter or data field is empty or is not a string.

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

File

vendor/auth0/auth0-php/tests/API/Management/ResourceServersTest.php, line 160

Class

ResourceServersTest
Class ResourceServersTest.

Namespace

Auth0\Tests\API\Management

Code

public function testUpdate() {
  $update_data = [
    'name' => 'TEST_PHP_SDK_UPDATE_' . uniqid(),
    'token_lifetime' => rand(20001, 30000),
    'signing_alg' => 'RS256',
    'scopes' => self::$scopes,
  ];
  $response = self::$api
    ->update(self::$serverIdentifier, $update_data);
  usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);
  $this
    ->assertEquals($update_data['name'], $response['name']);
  $this
    ->assertEquals($update_data['token_lifetime'], $response['token_lifetime']);
  $this
    ->assertEquals($update_data['signing_alg'], $response['signing_alg']);
  $this
    ->assertEquals($update_data['scopes'], $response['scopes']);
}