redirect() public method

Creates a RedirectResponse that will send the user to the OAuth2 server (e.g. send them to Facebook).
public redirect ( array $scopes = [] ) : RedirectResponse
$scopes array The scopes you want (leave empty to use default)
return Symfony\Component\HttpFoundation\RedirectResponse
 public function testRedirectWithoutState()
 {
     $requestStack = $this->prophesize('Symfony\\Component\\HttpFoundation\\RequestStack');
     $requestStack->getCurrentRequest()->shouldNotBeCalled();
     $this->provider->getAuthorizationUrl([])->willReturn('http://example.com');
     $client = new OAuth2Client($this->provider->reveal(), $requestStack->reveal());
     $client->setAsStateless();
     $response = $client->redirect();
     // don't need other checks - the fact that it didn't fail
     // by asking for the request and session is enough
     $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $response);
 }