AuthBucket\Bundle\OAuth2Bundle\Tests\GrantType\AuthorizationCodeGrantTypeHandlerTest::testExceptionAuthCodeNoSavedNoPassedRedirectUri PHP Метод

testExceptionAuthCodeNoSavedNoPassedRedirectUri() публичный Метод

    public function testExceptionAuthCodeNoSavedNoPassedRedirectUri()
    {
        $parameters = ['grant_type' => 'authorization_code', 'code' => '08fb55e26c84f8cb060b7803bc177af8'];
        $server = ['PHP_AUTH_USER' => 'http://democlient4.com/', 'PHP_AUTH_PW' => 'demosecret4'];
        $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']);
    }