mirror of
https://github.com/e107inc/e107.git
synced 2025-08-11 17:14:42 +02:00
Suppress uncaught Hybridauth exceptions in e_user_provider
And add a check for those exceptions in `social_ui::generateSocialLoginSection()` Fixes: #4192
This commit is contained in:
@@ -115,4 +115,32 @@ class e_user_providerTest extends \Codeception\Test\Unit
|
||||
$result = e_user_provider::getSupplementalFieldsOf("Vkontakte");
|
||||
$this->assertTrue(array_key_exists('photo_size', $result));
|
||||
}
|
||||
|
||||
public function testNewSuppressExceptions()
|
||||
{
|
||||
$this->assertInstanceOf(
|
||||
e_user_provider::class,
|
||||
new e_user_provider("Facebook", ["providers" => ["Facebook", ["enabled" => true]]])
|
||||
);
|
||||
}
|
||||
|
||||
public function testNewNoSuppressConfigurationException()
|
||||
{
|
||||
$this->expectException(\Hybridauth\Exception\InvalidArgumentException::class);
|
||||
new e_user_provider(
|
||||
"Facebook",
|
||||
["providers" => ["Facebook" => ["enabled" => true]]],
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
public function testNewNoSuppressDisabledException()
|
||||
{
|
||||
$this->expectException(\Hybridauth\Exception\UnexpectedValueException::class);
|
||||
new e_user_provider(
|
||||
"Facebook",
|
||||
["providers" => ["Facebook" => ["enabled" => false]]],
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user