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

testErrorCodeBadScopeFormat() public method

    public function testErrorCodeBadScopeFormat()
    {
        // Start session manually.
        $session = new Session(new MockFileSessionStorage());
        $session->start();
        $parameters = ['response_type' => 'code', 'client_id' => 'http://democlient1.com/', 'redirect_uri' => 'http://democlient1.com/redirect_uri', 'scope' => "aaa\"bbb\\cccddd", 'state' => $session->getId()];
        $server = ['PHP_AUTH_USER' => 'demousername1', 'PHP_AUTH_PW' => 'demopassword1'];
        $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']);
    }