public function testGetCodeInvalidCode()
{
$method = new \ReflectionMethod('Happyr\\LinkedIn\\Authenticator', 'getCode');
$method->setAccessible(true);
$storage = m::mock('Happyr\\LinkedIn\\Storage\\DataStorageInterface')->shouldReceive('get')->once()->with('code')->andReturn(null)->shouldReceive('get')->once()->with('state')->andReturn('bazbar')->getMock();
$auth = $this->getMock('Happyr\\LinkedIn\\Authenticator', ['getStorage'], [], '', false);
$auth->expects($this->once())->method('getStorage')->will($this->returnValue($storage));
$_REQUEST['code'] = 'foobar';
$_REQUEST['state'] = 'invalid';
$this->assertEquals('foobar', $method->invoke($auth));
}