AuthBucket\Bundle\OAuth2Bundle\Tests\Controller\OAuth2ControllerTest::testExceptionBadGrantType PHP Method

testExceptionBadGrantType() public method

    public function testExceptionBadGrantType()
    {
        $parameters = ['grant_type' => 'foo'];
        $server = [];
        $client = $this->createClient();
        $crawler = $client->request('POST', '/api/oauth2/token', $parameters, [], $server);
        $this->assertNotNull(json_decode($client->getResponse()->getContent()));
        $tokenResponse = json_decode($client->getResponse()->getContent(), true);
        $this->assertSame('invalid_request', $tokenResponse['error']);
    }