1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-22 06:03:27 +02:00

Core modifications to support Hybridauth 3

- MOD: Replaced e107::getPref('social_login') with
       SocialLoginConfigManager::getValidConfiguredProviderConfigs()
- FIX: signup_shortcodes updated with new social login providers
- MOD: e107::filter_request() code de-duplication: HTTP 400 exits
- MOD: Deprecated e107::getHybridAuth() to discourage direct access to
       third-party dependency Hybridauth
- FIX: Updated e_user_provider for Hybridauth 3
- FIX: e_user::tryProviderSession() and Hybridauth 3
- NEW: Dynamic auth provider support in social_adminarea
- NEW: Database migration for social plugin's social_login pref
This commit is contained in:
Nick Liu
2020-02-17 10:36:03 +01:00
parent 46c75ae4d0
commit 91bfc1df23
12 changed files with 1228 additions and 509 deletions

View File

@@ -0,0 +1,60 @@
<?php
/**
* e107 website system
*
* Copyright (C) 2008-2020 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
class e_user_providerTest extends \Codeception\Test\Unit
{
/** @var e_user_provider */
protected $e_user_provider;
protected function _before()
{
try
{
include_once(e_HANDLER . 'user_handler.php');
$this->e_user_provider = $this->make('e_user_provider');
}
catch (Exception $e)
{
$this->fail("Couldn't load e_user_provider object: {$e}");
}
}
public function testGetSupportedProviders()
{
$result = e_user_provider::getSupportedProviders();
$this->assertIsArray($result);
$this->assertContains("Facebook", $result);
$this->assertContains("Twitter", $result);
$this->assertCount(42, $result,
"The number of Hybridauth providers has changed! If this is intentional, note the change " .
"in Hybridauth providers in the release changelog and update the count in this test."
);
}
public function testGetProviderType()
{
$result = e_user_provider::getTypeOf("NotARealProvider");
$this->assertFalse($result);
$result = e_user_provider::getTypeOf("Steam");
$this->assertEquals("OpenID", $result);
$result = e_user_provider::getTypeOf("StackExchangeOpenID");
$this->assertEquals("OpenID", $result);
$result = e_user_provider::getTypeOf("Twitter");
$this->assertEquals("OAuth1", $result);
$result = e_user_provider::getTypeOf("WordPress");
$this->assertEquals("OAuth2", $result);
}
}