KnpU\OAuth2ClientBundle\Tests\Client\OAuth2ClientTest::testRedirectWithoutState PHP Method

testRedirectWithoutState() public method

    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);
    }