public function getError()
{
if ($this->hasError()) {
return new LoginError(GlobalVariableGetter::get('error'), GlobalVariableGetter::get('error_description'));
}
}
public function testGetErrorWithMissingDescription() { $linkedIn = new LinkedIn(self::APP_ID, self::APP_SECRET); unset($_GET['error']); unset($_GET['error_description']); $_GET['error'] = 'foo'; $this->assertEquals('foo', $linkedIn->getError()->getName()); $this->assertNull($linkedIn->getError()->getDescription()); }