You are here

public function Auth0Test::testThatGetLoginUrlOverridesDefaultValues in Auth0 Single Sign On 8.2

File

vendor/auth0/auth0-php/tests/Auth0Test.php, line 347

Class

Auth0Test
Class Auth0Test

Namespace

Auth0\Tests

Code

public function testThatGetLoginUrlOverridesDefaultValues() {
  $auth0 = new Auth0(self::$baseConfig);
  $override_params = [
    'scope' => 'openid profile email',
    'response_type' => 'id_token',
    'response_mode' => 'form_post',
  ];
  $auth_url = $auth0
    ->getLoginUrl($override_params);
  $parsed_url_query = parse_url($auth_url, PHP_URL_QUERY);
  $url_query = explode('&', $parsed_url_query);
  $this
    ->assertContains('scope=openid%20profile%20email', $url_query);
  $this
    ->assertContains('response_type=id_token', $url_query);
  $this
    ->assertContains('response_mode=form_post', $url_query);
  $this
    ->assertContains('redirect_uri=__test_redirect_uri__', $url_query);
  $this
    ->assertContains('client_id=__test_client_id__', $url_query);
}