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