AdamWathan\EloquentOAuth\OAuthManager::authorize PHP Method

authorize() public method

public authorize ( $providerAlias )
    public function authorize($providerAlias)
    {
        return $this->redirect->to($this->socialnorm->authorize($providerAlias));
    }

Usage Example

 public function test_it_returns_a_redirect_to_the_authorize_url()
 {
     $redirector = $this->buildRedirector();
     $authenticator = M::mock('AdamWathan\\EloquentOAuth\\Authenticator');
     $socialnorm = M::mock('SocialNorm\\SocialNorm');
     $socialnorm->shouldReceive('authorize')->with('example')->andReturn('http://example.com/authorize');
     $oauth = new OAuthManager($redirector, $authenticator, $socialnorm);
     $response = $oauth->authorize('example');
     $this->assertEquals('http://example.com/authorize', $response->getTargetUrl());
 }
All Usage Examples Of AdamWathan\EloquentOAuth\OAuthManager::authorize