public function testWithAuthorizationCodeCredentialsInRequestBody()
{
$client = new Client();
$mock = new MockPlugin();
$mock->addResponse(new Response(200, null, $this->tokenResponse[0]));
$client->addSubscriber($mock);
$history = new HistoryPlugin();
$history->setLimit(5);
$client->addSubscriber($history);
$tokenRequest = new TokenRequest($client, $this->clientConfig[1]);
$tokenRequest->withAuthorizationCode("12345");
$lastRequest = $history->getLastRequest();
$this->assertEquals("POST", $lastRequest->getMethod());
$this->assertEquals("code=12345&grant_type=authorization_code&redirect_uri=http%3A%2F%2Ffoo.example.org%2Fcallback&client_id=foo&client_secret=bar", $lastRequest->getPostFields()->__toString());
$this->assertEquals("application/x-www-form-urlencoded; charset=utf-8", $lastRequest->getHeader("Content-Type"));
}