protected function prepareGetAccessTokenFromCode($code, $responseData)
{
$response = new Response(200, [], json_encode($responseData));
$currentUrl = 'foobar';
$storage = m::mock('Happyr\\LinkedIn\\Storage\\DataStorageInterface')->shouldReceive('get')->with('redirect_uri')->andReturn($currentUrl)->getMock();
$requestManager = m::mock('Happyr\\LinkedIn\\Http\\RequestManager')->shouldReceive('sendRequest')->once()->with('POST', 'url', ['Content-Type' => 'application/x-www-form-urlencoded'], http_build_query(['grant_type' => 'authorization_code', 'code' => $code, 'redirect_uri' => $currentUrl, 'client_id' => self::APP_ID, 'client_secret' => self::APP_SECRET]))->andReturn($response)->getMock();
$auth = $this->getMock('Happyr\\LinkedIn\\Authenticator', ['getStorage'], [$requestManager, self::APP_ID, self::APP_SECRET]);
$auth->expects($this->any())->method('getStorage')->will($this->returnValue($storage));
return $auth;
}