public function testIsAuthenticated()
{
$linkedIn = $this->getMock('Happyr\\LinkedIn\\LinkedIn', ['getAccessToken'], [self::APP_ID, self::APP_SECRET]);
$linkedIn->expects($this->once())->method('getAccessToken')->willReturn(null);
$this->assertFalse($linkedIn->isAuthenticated());
$linkedIn = $this->getMock('Happyr\\LinkedIn\\LinkedIn', ['api', 'getAccessToken'], [self::APP_ID, self::APP_SECRET]);
$linkedIn->expects($this->once())->method('getAccessToken')->willReturn('token');
$linkedIn->expects($this->once())->method('api')->willReturn(['id' => 4711]);
$this->assertTrue($linkedIn->isAuthenticated());
$linkedIn = $this->getMock('Happyr\\LinkedIn\\LinkedIn', ['api', 'getAccessToken'], [self::APP_ID, self::APP_SECRET]);
$linkedIn->expects($this->once())->method('getAccessToken')->willReturn('token');
$linkedIn->expects($this->once())->method('api')->willReturn(['foobar' => 4711]);
$this->assertFalse($linkedIn->isAuthenticated());
}