AuthBucket\Bundle\OAuth2Bundle\Tests\ResponseType\CodeResponseTypeHandlerTest::testErrorCodeBadStateFormat PHP Method

testErrorCodeBadStateFormat() public method

    public function testErrorCodeBadStateFormat()
    {
        $parameters = ['response_type' => 'code', 'client_id' => 'http://democlient3.com/', 'redirect_uri' => 'http://democlient3.com/redirect_uri', 'scope' => 'demoscope1 demoscope2 demoscope3', 'state' => "aaabbbccc"];
        $server = ['PHP_AUTH_USER' => 'demousername3', 'PHP_AUTH_PW' => 'demopassword3'];
        $client = $this->createClient();
        $crawler = $client->request('GET', '/api/oauth2/authorize', $parameters, [], $server);
        $this->assertTrue($client->getResponse()->isRedirect());
        $authResponse = Request::create($client->getResponse()->headers->get('Location'), 'GET');
        $tokenResponse = $authResponse->query->all();
        $this->assertSame('invalid_request', $tokenResponse['error']);
    }