AuthBucket\Bundle\OAuth2Bundle\Tests\GrantType\AuthorizationCodeGrantTypeHandlerTest::testExceptionAuthCodeBadRedirectUriFormat PHP Method

testExceptionAuthCodeBadRedirectUriFormat() public method

    public function testExceptionAuthCodeBadRedirectUriFormat()
    {
        $parameters = ['grant_type' => 'authorization_code', 'code' => 'f0c68d250bcc729eb780a235371a9a55', 'redirect_uri' => "aaa\"bbb\\cccddd"];
        $server = ['PHP_AUTH_USER' => 'http://democlient2.com/', 'PHP_AUTH_PW' => 'demosecret2'];
        $client = $this->createClient();
        $crawler = $client->request('POST', '/api/oauth2/token', $parameters, [], $server);
        $this->assertSame(400, $client->getResponse()->getStatusCode());
        $this->assertNotNull(json_decode($client->getResponse()->getContent()));
        $tokenResponse = json_decode($client->getResponse()->getContent(), true);
        $this->assertSame('invalid_request', $tokenResponse['error']);
    }